Module: Roart::MethodFunctions

Included in:
Ticket
Defined in:
lib/roart/roart.rb

Instance Method Summary collapse

Instance Method Details

#add_methods!Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/roart/roart.rb', line 14

def add_methods!
  @attributes.each do |key, value|
    (class << self; self; end).send :define_method, key do
      return @attributes[key]
    end
    (class << self; self; end).send :define_method, "#{key}=" do |new_val|
      @attributes[key] = new_val
    end
  end 
end