Module: Roart::MethodFunctions

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

Instance Method Summary collapse

Instance Method Details

#add_methods!Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/roart/roart.rb', line 22

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