Sha256: df0d9a06c01ae6a112b3165bc4fb419a3b2798ab67f26e8c000b7cac756ed605

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

module Moped
  module Protocol

    # This is a convenience class on top of +Query+ for quickly creating a
    # command.
    #
    # @example
    #   command = Moped::Protocol::Command.new :moped, ismaster: 1
    #   socket.write command.serialize
    class Command < Query

      # @param [String, Symbol] database the database to run this command on
      # @param [Hash] command the command to run
      def initialize(database, command)
        super database, :$cmd, command, limit: -1
      end

      def log_inspect
        type = "COMMAND"

        "%-12s database=%s command=%s" % [type, database, selector.inspect]
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moped-1.0.0.alpha lib/moped/protocol/command.rb