Instantiates new Bunny::Client
# File lib/bunny.rb, line 29 def self.new(opts = {}) # Set up Bunny according to AMQP spec version required spec_version = opts[:spec] || '08' # Return client setup(spec_version, opts) end
Runs a code block using a short-lived connection
# File lib/bunny.rb, line 39 def self.run(opts = {}, &block) raise ArgumentError, 'Bunny#run requires a block' unless block # Set up Bunny according to AMQP spec version required spec_version = opts[:spec] || '08' client = setup(spec_version, opts) begin client.start block.call(client) ensure client.stop end # Return success :run_ok end
Returns the Bunny version number
# File lib/bunny.rb, line 23 def self.version VERSION end
Generated with the Darkfish Rdoc Generator 2.