Class: Core::Initializable::Initializer
- Inherits:
-
Object
- Object
- Core::Initializable::Initializer
- Defined in:
- app/api/core/initializable.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(owner) ⇒ Initializer
constructor
A new instance of Initializer.
Constructor Details
#initialize(owner) ⇒ Initializer
Returns a new instance of Initializer.
5 6 7 |
# File 'app/api/core/initializable.rb', line 5 def initialize(owner) @owner = owner end |
Class Method Details
.delegate_to_owner(*names) ⇒ Object
15 16 17 |
# File 'app/api/core/initializable.rb', line 15 def delegate_to_owner(*names) delegate(*names, to: :@owner) end |
.delegated_attribute_writer(*names) ⇒ Object
10 11 12 13 |
# File 'app/api/core/initializable.rb', line 10 def delegated_attribute_writer(*names) names.each { |name| class_eval("def #{name}=(value) ; @owner.instance_variable_set(:@#{name}, value) ; end") } delegate_to_owner(*names) end |