Sha256: 86582c788493b710734fa8aeed194cc2316e79e5dafbe1080bd0817b4bb48e8f

Contents?: true

Size: 843 Bytes

Versions: 11

Compression:

Stored size: 843 Bytes

Contents

# --
# Copyright (C) 2008-2009 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ++

module Mongo

  # JavaScript code to be evaluated by MongoDB
  class Code < String
    # Hash mapping identifiers to their values
    attr_accessor :scope

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

  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
mongodb-mongo-0.13 lib/mongo/types/code.rb
mongodb-mongo-0.14.1 lib/mongo/types/code.rb
mongodb-mongo-0.14 lib/mongo/types/code.rb
pahagon-mongo-abd-0.14.1 lib/mongo/types/code.rb
mongo-0.18.1 lib/mongo/types/code.rb
mongo-0.18 lib/mongo/types/code.rb
mongo-0.17.1 lib/mongo/types/code.rb
mongo-0.17 lib/mongo/types/code.rb
mongo-0.16 lib/mongo/types/code.rb
mongo-0.15.1 lib/mongo/types/code.rb
mongo-0.15 lib/mongo/types/code.rb