JavaScript code to be evaluated by MongoDB.
Wrap code to be evaluated by MongoDB.
@param [String] code the JavaScript code. @param [Hash] a document mapping identifiers to values, which
represent the scope in which the code is to be executed.
# File lib/bson/types/code.rb, line 28 def initialize(code, scope={}) @code = code @scope = scope unless @code.is_a?(String) raise ArgumentError, "BSON::Code must be in the form of a String; #{@code.class} is not allowed." end end
# File lib/bson/types/code.rb, line 41 def ==(other) self.class == other.class && @code == other.code && @scope == other.scope end
Generated with the Darkfish Rdoc Generator 2.