Sha256: b23dae8a12f541d74e53d802efd523264155d57e4b76e1db5cd2e9f4fb4df3e1

Contents?: true

Size: 1.13 KB

Versions: 17

Compression:

Stored size: 1.13 KB

Contents

# encoding: utf-8
module Moped

  # Provides behaviour around readable objects.
  #
  # @since 2.0.0
  module Readable

    private

    # Convenience method for getting the cluster from the session.
    #
    # @api private
    #
    # @example Get the cluster from the session.
    #   database.cluster
    #
    # @return [ Cluster ] The cluster.
    #
    # @since 2.0.0
    def cluster
      session.cluster
    end

    # Convenience method for getting the read preference from the session.
    #
    # @api private
    #
    # @example Get the read preference.
    #   database.read_preference
    #
    # @return [ Object ] The session's read preference.
    #
    # @since 2.0.0
    def read_preference
      session.read_preference
    end

    # Get the query options from the read preference.
    #
    # @api private
    #
    # @example Get the query options.
    #   database.query_options
    #
    # @param [ Hash ] options The existing options on the query.
    #
    # @return [ Hash ] The new query options.
    #
    # @since 2.0.0
    def query_options(options = {})
      read_preference.query_options(options)
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/bundler/gems/moped-cf817ca58a85/lib/moped/readable.rb
moped-2.0.7 lib/moped/readable.rb
moped-2.0.6 lib/moped/readable.rb
moped-2.0.5 lib/moped/readable.rb
moped-2.0.4 lib/moped/readable.rb
moped-2.0.3 lib/moped/readable.rb
moped-2.0.2 lib/moped/readable.rb
moped-2.0.1 lib/moped/readable.rb
moped-2.0.0 lib/moped/readable.rb
moped-2.0.0.rc2 lib/moped/readable.rb
moped-2.0.0.rc1 lib/moped/readable.rb
moped-2.0.0.beta6 lib/moped/readable.rb
moped-2.0.0.beta5 lib/moped/readable.rb
moped-2.0.0.beta4 lib/moped/readable.rb
moped-2.0.0.beta3 lib/moped/readable.rb
moped-2.0.0.beta2 lib/moped/readable.rb
moped-2.0.0.beta lib/moped/readable.rb