Class: RgGen::Builder::InputComponentStore
- Inherits:
-
ComponentStore
- Object
- ComponentStore
- RgGen::Builder::InputComponentStore
- Defined in:
- lib/rggen/builder/input_component_store.rb
Instance Method Summary collapse
- #build_factory ⇒ Object
- #define_loader(type_or_types, &body) ⇒ Object
-
#initialize(builder, component_name) ⇒ InputComponentStore
constructor
A new instance of InputComponentStore.
Methods inherited from ComponentStore
Constructor Details
#initialize(builder, component_name) ⇒ InputComponentStore
Returns a new instance of InputComponentStore.
4 5 6 7 |
# File 'lib/rggen/builder/input_component_store.rb', line 4 def initialize(builder, component_name) super(builder, component_name) @loaders = [] end |
Instance Method Details
#build_factory ⇒ Object
18 19 20 21 22 |
# File 'lib/rggen/builder/input_component_store.rb', line 18 def build_factory super.tap do |f| f.loaders = @loaders end end |
#define_loader(type_or_types, &body) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/rggen/builder/input_component_store.rb', line 11 def define_loader(type_or_types, &body) return unless loader_base @loaders << Class.new(loader_base, &body).tap do |l| l.supported_types = Array(type_or_types) end end |