mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Use macro to DRY the self.default method
This commit is contained in:
@@ -21,12 +21,7 @@ class Storage
|
||||
id: String,
|
||||
is_title: Bool)
|
||||
|
||||
def self.default : self
|
||||
unless @@default
|
||||
@@default = new
|
||||
end
|
||||
@@default.not_nil!
|
||||
end
|
||||
use_default
|
||||
|
||||
def initialize(db_path : String? = nil, init_user = true, *,
|
||||
@auto_close = true)
|
||||
|
||||
Reference in New Issue
Block a user