Sha256: 6bbc51a4db97aeafe4b0397c6dbfbfd22c34e478e3cc7a589dfbaa669ab8686f

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 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_endpoint.user
    end

    def add_permissions_for_vhost(vhost)
      client.update_permissions_of(vhost, user, {
        :configure => ".*",
        :write     => ".*",
        :read       => ".*"
      })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rabbitmq-definition-0.1.3 lib/rabbitmq_definition/command.rb