Module: Tyrion::Attributes::ClassMethods

Defined in:
lib/tyrion/attributes.rb

Instance Method Summary collapse

Instance Method Details

#field(name, type = String) ⇒ Object



6
7
8
9
10
11
# File 'lib/tyrion/attributes.rb', line 6

def field(name, type = String)
  name = name.to_s
  
  define_method("#{name}"){ attributes[name] }
  define_method("#{name}="){ |value| attributes[name] = value }
end