Module: CouchRest::Mixins::Properties::ClassMethods

Defined in:
lib/couchrest/mixins/properties.rb

Instance Method Summary collapse

Instance Method Details

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



91
92
93
94
95
96
# File 'lib/couchrest/mixins/properties.rb', line 91

def property(name, options={})
  existing_property = self.properties.find{|p| p.name == name.to_s}
  if existing_property.nil? || (existing_property.default != options[:default])
    define_property(name, options)
  end
end