Module: MongoMapper::Plugins::StrictKeys::InstanceMethods
- Defined in:
- lib/mongo_mapper/strict_keys.rb
Instance Method Summary collapse
-
#ensure_key_exists(name) ⇒ true
This method either returns true or raises an exception.
Instance Method Details
#ensure_key_exists(name) ⇒ true
Returns This method either returns true or raises an exception.
18 19 20 21 22 23 |
# File 'lib/mongo_mapper/strict_keys.rb', line 18 def ensure_key_exists(name) unless respond_to?("#{name}=") raise ArgumentError.new("Attribute '#{name}' has not been explicitly defined as a key.") end true end |