Module: Slingshot::Model::Persistence::Attributes::ClassMethods

Defined in:
lib/slingshot/model/persistence/attributes.rb

Instance Method Summary collapse

Instance Method Details

#propertiesObject



20
21
22
# File 'lib/slingshot/model/persistence/attributes.rb', line 20

def properties
  @properties ||= []
end

#property(name, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/slingshot/model/persistence/attributes.rb', line 10

def property(name, options = {})
  # p "#{self}, PERSISTENCE PROPERTY, #{name}"
  attr_accessor name.to_sym
  properties << name.to_s unless properties.include?(name.to_s)
  define_query_method      name.to_sym
  define_attribute_methods [name.to_sym]
  mapping[name] = options if store_mapping?
  self
end