Module: Virgola::AttributeMethods::ClassMethods
- Defined in:
- lib/virgola/attribute_methods.rb
Instance Method Summary collapse
Instance Method Details
#attribute(name, options = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/virgola/attribute_methods.rb', line 21 def attribute(name, ={}) define_attribute_methods Array.wrap name attribute = Attribute.new(name.to_sym, .delete(:type), ) attributes << attribute unless attributes.include?(attribute) end |
#attributes ⇒ Object
17 18 19 |
# File 'lib/virgola/attribute_methods.rb', line 17 def attributes @attributes ||= [] end |