Module: MongoMapper::Plugins::Modifiers
- Extended by:
- ActiveSupport::Concern
- Included in:
- Document
- Defined in:
- lib/mongo_mapper/plugins/modifiers.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #add_to_set(hash, options = nil) ⇒ Object (also: #push_uniq)
- #decrement(hash, options = nil) ⇒ Object
- #increment(hash, options = nil) ⇒ Object
- #pop(hash, options = nil) ⇒ Object
- #pull(hash, options = nil) ⇒ Object
- #pull_all(hash, options = nil) ⇒ Object
- #push(hash, options = nil) ⇒ Object
- #push_all(hash, options = nil) ⇒ Object
- #set(hash, options = nil) ⇒ Object
- #unset(*args) ⇒ Object
Instance Method Details
#add_to_set(hash, options = nil) ⇒ Object Also known as: push_uniq
145 146 147 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 145 def add_to_set(hash, =nil) self.class.push_uniq({:_id => id}, hash, ) end |
#decrement(hash, options = nil) ⇒ Object
121 122 123 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 121 def decrement(hash, =nil) self.class.decrement({:_id => id}, hash, ) end |
#increment(hash, options = nil) ⇒ Object
117 118 119 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 117 def increment(hash, =nil) self.class.increment({:_id => id}, hash, ) end |
#pop(hash, options = nil) ⇒ Object
150 151 152 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 150 def pop(hash, =nil) self.class.pop({:_id => id}, hash, ) end |
#pull(hash, options = nil) ⇒ Object
137 138 139 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 137 def pull(hash, =nil) self.class.pull({:_id => id}, hash, ) end |
#pull_all(hash, options = nil) ⇒ Object
141 142 143 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 141 def pull_all(hash, =nil) self.class.pull_all({:_id => id}, hash, ) end |
#push(hash, options = nil) ⇒ Object
129 130 131 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 129 def push(hash, =nil) self.class.push({:_id => id}, hash, ) end |
#push_all(hash, options = nil) ⇒ Object
133 134 135 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 133 def push_all(hash, =nil) self.class.push_all({:_id => id}, hash, ) end |
#set(hash, options = nil) ⇒ Object
125 126 127 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 125 def set(hash, =nil) self.class.set({:_id => id}, hash, ) end |
#unset(*args) ⇒ Object
113 114 115 |
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 113 def unset(*args) self.class.unset({:_id => id}, *args) end |