Module: YAS::AttributeExt::ClassMethods
- Defined in:
- lib/yas/ext/attribute.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #key(*attrs, &block) ⇒ Object (also: #attribute)
Instance Method Details
#attributes ⇒ Object
18 19 20 |
# File 'lib/yas/ext/attribute.rb', line 18 def attributes @attributes ||= {} end |
#key(*attrs, &block) ⇒ Object Also known as: attribute
8 9 10 11 12 13 14 |
# File 'lib/yas/ext/attribute.rb', line 8 def key *attrs, &block attrs.each do |attr| new_attr = Attribute.new(attr) new_attr.instance_eval(&block) if block attributes[attr] = new_attr end end |