Class: Bismas::Base
- Inherits:
-
Object
- Object
- Bismas::Base
- Defined in:
- lib/bismas/base.rb
Instance Attribute Summary collapse
-
#auto_id ⇒ Object
Returns the value of attribute auto_id.
-
#io ⇒ Object
Returns the value of attribute io.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ Base
constructor
A new instance of Base.
- #reset ⇒ Object
Constructor Details
#initialize(options = {}, &block) ⇒ Base
Returns a new instance of Base.
49 50 51 52 53 54 55 56 57 |
# File 'lib/bismas/base.rb', line 49 def initialize( = {}, &block) self.key = [:key] self.io = .fetch(:io, self.class::DEFAULT_IO) @auto_id_block = .fetch(:auto_id, block) = reset end |
Instance Attribute Details
#auto_id ⇒ Object
Returns the value of attribute auto_id.
59 60 61 |
# File 'lib/bismas/base.rb', line 59 def auto_id @auto_id end |
#io ⇒ Object
Returns the value of attribute io.
59 60 61 |
# File 'lib/bismas/base.rb', line 59 def io @io end |
#key ⇒ Object
Returns the value of attribute key.
59 60 61 |
# File 'lib/bismas/base.rb', line 59 def key @key end |
Instance Method Details
#reset ⇒ Object
61 62 63 |
# File 'lib/bismas/base.rb', line 61 def reset @auto_id = @auto_id_block ? @auto_id_block.call : default_auto_id end |