Class: BB::Factory
- Inherits:
-
Object
- Object
- BB::Factory
- Extended by:
- Forwardable
- Defined in:
- lib/b_b/factory.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type_of_component ⇒ Object
Returns the value of attribute type_of_component.
Class Method Summary collapse
Instance Method Summary collapse
- #append_formatted_filters(args) ⇒ Object
-
#initialize ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize ⇒ Factory
Returns a new instance of Factory.
8 9 10 11 |
# File 'lib/b_b/factory.rb', line 8 def initialize @filters = [] @options = {} end |
Instance Attribute Details
#filters ⇒ Object
Returns the value of attribute filters.
5 6 7 |
# File 'lib/b_b/factory.rb', line 5 def filters @filters end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/b_b/factory.rb', line 5 def @options end |
#type_of_component ⇒ Object
Returns the value of attribute type_of_component.
5 6 7 |
# File 'lib/b_b/factory.rb', line 5 def type_of_component @type_of_component end |
Class Method Details
.build(name) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/b_b/factory.rb', line 47 def build(name) decorator = FactoryDecorator.const_get(format_decorator_name(name)) new.extend(decorator).tap do |factory| factory.type_of_component = name end end |
Instance Method Details
#append_formatted_filters(args) ⇒ Object
15 16 17 18 |
# File 'lib/b_b/factory.rb', line 15 def append_formatted_filters(args) (args) format_filters(args).each { |filter| filters << filter } end |