Class: Banken::DSL::Factory
- Inherits:
-
Object
- Object
- Banken::DSL::Factory
- Defined in:
- lib/banken/dsl/factory.rb
Constant Summary collapse
- SUFFIX =
"Loyalty".freeze
Instance Attribute Summary collapse
-
#base_controller_name ⇒ Object
readonly
Returns the value of attribute base_controller_name.
-
#controller_name ⇒ Object
readonly
Returns the value of attribute controller_name.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(controller) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(controller) ⇒ Factory
Returns a new instance of Factory.
8 9 10 11 |
# File 'lib/banken/dsl/factory.rb', line 8 def initialize(controller) @controller_name = extract_controller_name(controller) @base_controller_name = extract_controller_name(controller.superclass) end |
Instance Attribute Details
#base_controller_name ⇒ Object (readonly)
Returns the value of attribute base_controller_name.
6 7 8 |
# File 'lib/banken/dsl/factory.rb', line 6 def base_controller_name @base_controller_name end |
#controller_name ⇒ Object (readonly)
Returns the value of attribute controller_name.
6 7 8 |
# File 'lib/banken/dsl/factory.rb', line 6 def controller_name @controller_name end |
Instance Method Details
#create ⇒ Object
13 14 15 |
# File 'lib/banken/dsl/factory.rb', line 13 def create Object.const_set(loyalty_name, loyalty_klass) end |