Sha256: 529e6c0051b5926868be34000b4ab431826176ae93217ae9606674ddff80a959

Contents?: true

Size: 451 Bytes

Versions: 3

Compression:

Stored size: 451 Bytes

Contents

module RabbitMQ::Definition
  class Command
    attr_accessor :client, :verbose

    def self.run(*args)
      new(*args).execute
    end

    def initialize(client, verbose)
      @client = client
      @verbose = !!verbose
    end

    def execute
      raise NotImplementedError
    end

    protected

    def uri_endpoint
      @uri_endpoint ||= URI.parse(client.endpoint)
    end

    def user
      @uri ||= uri_endpoint.user
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rabbitmq-definition-0.1.2 lib/rabbitmq_definition/command.rb
rabbitmq-definition-0.1.1 lib/rabbitmq_definition/command.rb
rabbitmq-definition-0.1.0 lib/rabbitmq_definition/command.rb