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

Instance Method Details

#add_to_set(hash, options = nil) ⇒ Object Also known as: push_uniq



144
145
146
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 144

def add_to_set(hash, options=nil)
  self.class.push_uniq({:_id => id}, hash, options)
end

#decrement(hash, options = nil) ⇒ Object



120
121
122
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 120

def decrement(hash, options=nil)
  self.class.decrement({:_id => id}, hash, options)
end

#increment(hash, options = nil) ⇒ Object



116
117
118
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 116

def increment(hash, options=nil)
  self.class.increment({:_id => id}, hash, options)
end

#pop(hash, options = nil) ⇒ Object



149
150
151
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 149

def pop(hash, options=nil)
  self.class.pop({:_id => id}, hash, options)
end

#pull(hash, options = nil) ⇒ Object



136
137
138
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 136

def pull(hash, options=nil)
  self.class.pull({:_id => id}, hash, options)
end

#pull_all(hash, options = nil) ⇒ Object



140
141
142
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 140

def pull_all(hash, options=nil)
  self.class.pull_all({:_id => id}, hash, options)
end

#push(hash, options = nil) ⇒ Object



128
129
130
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 128

def push(hash, options=nil)
  self.class.push({:_id => id}, hash, options)
end

#push_all(hash, options = nil) ⇒ Object



132
133
134
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 132

def push_all(hash, options=nil)
  self.class.push_all({:_id => id}, hash, options)
end

#set(hash, options = nil) ⇒ Object



124
125
126
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 124

def set(hash, options=nil)
  self.class.set({:_id => id}, hash, options)
end

#unset(*args) ⇒ Object



112
113
114
# File 'lib/mongo_mapper/plugins/modifiers.rb', line 112

def unset(*args)
  self.class.unset({:_id => id}, *args)
end