Class: RgGen::Builder::SimpleItemEntry
- Inherits:
-
Object
- Object
- RgGen::Builder::SimpleItemEntry
- Defined in:
- lib/rggen/builder/simple_item_entry.rb
Instance Attribute Summary collapse
-
#factory ⇒ Object
readonly
Returns the value of attribute factory.
-
#item_class ⇒ Object
readonly
Returns the value of attribute item_class.
Instance Method Summary collapse
- #build_factory ⇒ Object
-
#initialize(base, factory, context, &body) ⇒ SimpleItemEntry
constructor
A new instance of SimpleItemEntry.
Constructor Details
#initialize(base, factory, context, &body) ⇒ SimpleItemEntry
Returns a new instance of SimpleItemEntry.
4 5 6 7 |
# File 'lib/rggen/builder/simple_item_entry.rb', line 4 def initialize(base, factory, context, &body) @item_class = define_item_class(base, context, body) @factory = factory end |
Instance Attribute Details
#factory ⇒ Object (readonly)
Returns the value of attribute factory.
10 11 12 |
# File 'lib/rggen/builder/simple_item_entry.rb', line 10 def factory @factory end |
#item_class ⇒ Object (readonly)
Returns the value of attribute item_class.
9 10 11 |
# File 'lib/rggen/builder/simple_item_entry.rb', line 9 def item_class @item_class end |
Instance Method Details
#build_factory ⇒ Object
12 13 14 15 16 |
# File 'lib/rggen/builder/simple_item_entry.rb', line 12 def build_factory @factory.new.tap do |f| f.target_item = @item_class end end |