Class: RgGen::Builder::SimpleItemEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/rggen/builder/simple_item_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#factoryObject (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_classObject (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_factoryObject



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