Method: MongoMapper::Plugins::Keys::Key#initialize

Defined in:
lib/mongo_mapper/plugins/keys.rb

#initialize(*args) ⇒ Key

Returns a new instance of Key.



299
300
301
302
303
304
# File 'lib/mongo_mapper/plugins/keys.rb', line 299

def initialize(*args)
  options = args.extract_options!
  @name, @type = args.shift.to_s, args.shift
  self.options = (options || {}).symbolize_keys
  self.default_value = self.options.delete(:default)
end