Sha256: 940a483ff75a996db8a7a361f92a5048ed0486bbb6c6c33dae1d93d615090f49

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

module Fluffle
  module Connectable
    def self.included(klass)
      klass.class_eval do
        attr_reader :connection
      end
    end

    def connect(*args)
      self.stop if self.connected?

      @connection = Bunny.new *args
      @connection.start
    end

    def connected?
      @connection && @connection.connected?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluffle-0.2.0 lib/fluffle/connectable.rb