Class: LittleBoxes::EntryDefinition
- Inherits:
-
Object
- Object
- LittleBoxes::EntryDefinition
- Defined in:
- lib/little_boxes/entry_definition.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#configure ⇒ Object
Returns the value of attribute configure.
-
#eager ⇒ Object
Returns the value of attribute eager.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #eager! ⇒ Object
- #for(box) ⇒ Object
-
#initialize(name, eager: false, memo: false, configure: false, then_block: nil, &block) ⇒ EntryDefinition
constructor
A new instance of EntryDefinition.
- #then(&block) ⇒ Object
Constructor Details
#initialize(name, eager: false, memo: false, configure: false, then_block: nil, &block) ⇒ EntryDefinition
5 6 7 8 9 10 11 |
# File 'lib/little_boxes/entry_definition.rb', line 5 def initialize(name, eager: false, memo: false, configure: false, then_block: nil, &block) self.name = name self.memo = memo self.eager = eager self.configure = configure self.block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
3 4 5 |
# File 'lib/little_boxes/entry_definition.rb', line 3 def block @block end |
#configure ⇒ Object
Returns the value of attribute configure.
3 4 5 |
# File 'lib/little_boxes/entry_definition.rb', line 3 def configure @configure end |
#eager ⇒ Object
Returns the value of attribute eager.
3 4 5 |
# File 'lib/little_boxes/entry_definition.rb', line 3 def eager @eager end |
#memo ⇒ Object
Returns the value of attribute memo.
3 4 5 |
# File 'lib/little_boxes/entry_definition.rb', line 3 def memo @memo end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/little_boxes/entry_definition.rb', line 3 def name @name end |
Instance Method Details
#eager! ⇒ Object
13 14 15 |
# File 'lib/little_boxes/entry_definition.rb', line 13 def eager! self.eager = true end |
#for(box) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/little_boxes/entry_definition.rb', line 17 def for(box) Entry.new( name: name, box: box, block: block, memo: memo, configure: configure, eager: eager, then_block: @then_block ) end |
#then(&block) ⇒ Object
24 25 26 |
# File 'lib/little_boxes/entry_definition.rb', line 24 def then(&block) @then_block = block end |