Method: YAS::AttributeExt::ClassMethods#key
- Defined in:
- lib/yas/ext/attribute.rb
#key(attr, &block) ⇒ Object Also known as: attribute
8 9 10 11 12 13 |
# File 'lib/yas/ext/attribute.rb', line 8 def key attr, &block new_attr = Attribute.new(attr) new_attr.instance_eval &block if block attributes[attr] = new_attr new_attr end |