Class: Outback::AttrSetter

Inherits:
Object show all
Defined in:
lib/outback/support/attr_setter.rb

Instance Method Summary collapse

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|
    meta_def(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