Class: MongoScope::Scope

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/mongo_scope.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FromHash

#from_hash, #initialize

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



109
110
111
# File 'lib/mongo_scope.rb', line 109

def field
  @field
end

#opObject

Returns the value of attribute op.



109
110
111
# File 'lib/mongo_scope.rb', line 109

def op
  @op
end

#valObject

Returns the value of attribute val.



109
110
111
# File 'lib/mongo_scope.rb', line 109

def val
  @val
end

Class Method Details

.new(ops) ⇒ Object



106
107
108
# File 'lib/mongo_scope.rb', line 106

def self.new(ops)
  ops.respond_to?(:find_ops) ? ops : super(ops)
end

Instance Method Details

#find_opsObject



111
112
113
# File 'lib/mongo_scope.rb', line 111

def find_ops
  {field => {op => val}}
end