Module: Tyrion::Attributes::ClassMethods

Defined in:
lib/tyrion/attributes.rb

Instance Method Summary collapse

Instance Method Details

#field(name, type = String) ⇒ Object



9
10
11
12
13
14
# File 'lib/tyrion/attributes.rb', line 9

def field(name, type = String)
  name = name.to_s

  define_method("#{name}"){ attributes[name] }
  define_method("#{name}="){ |value| attributes[name] = value }
end