Class: Mongo::Code

Inherits:
String
  • Object
show all
Defined in:
lib/mongo/types/code.rb

Overview

JavaScript code to be evaluated by MongoDB

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, scope = {}) ⇒ Code

Returns a new instance of Code.



24
25
26
27
# File 'lib/mongo/types/code.rb', line 24

def initialize(code, scope={})
  super(code)
  @scope = scope
end

Instance Attribute Details

#scopeObject

Hash mapping identifiers to their values



22
23
24
# File 'lib/mongo/types/code.rb', line 22

def scope
  @scope
end