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, options={})
  define_attribute_methods Array.wrap name
  attribute = Attribute.new(name.to_sym, options.delete(:type), options)
  attributes << attribute unless attributes.include?(attribute)
end

#attributesObject



17
18
19
# File 'lib/virgola/attribute_methods.rb', line 17

def attributes
  @attributes ||= []
end