Class: Outback::AttrSetter
Instance Method Summary collapse
-
#initialize(configurable) ⇒ AttrSetter
constructor
A new instance of AttrSetter.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(configurable) ⇒ AttrSetter
Returns a new instance of AttrSetter.
4 5 6 7 8 9 10 11 |
# File 'lib/outback/support/attr_setter.rb', line 4 def initialize(configurable) @configurable = configurable configurable.class.attributes.each do |name| (name) do |value| write_attribute(name, value) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
13 14 15 |
# File 'lib/outback/support/attr_setter.rb', line 13 def method_missing(name, *args, &block) @configurable.send(name, *args, &block) end |