Class: HotBunnies::Queue::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/hot_bunnies/queue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel, consumer_tag, envelope, properties) ⇒ Headers

Returns a new instance of Headers.



264
265
266
267
268
269
# File 'lib/hot_bunnies/queue.rb', line 264

def initialize(channel, consumer_tag, envelope, properties)
  @channel = channel
  @consumer_tag = consumer_tag
  @envelope = envelope
  @properties = properties
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



262
263
264
# File 'lib/hot_bunnies/queue.rb', line 262

def channel
  @channel
end

#consumer_tagObject (readonly)

Returns the value of attribute consumer_tag.



262
263
264
# File 'lib/hot_bunnies/queue.rb', line 262

def consumer_tag
  @consumer_tag
end

#envelopeObject (readonly)

Returns the value of attribute envelope.



262
263
264
# File 'lib/hot_bunnies/queue.rb', line 262

def envelope
  @envelope
end

#propertiesObject (readonly)

Returns the value of attribute properties.



262
263
264
# File 'lib/hot_bunnies/queue.rb', line 262

def properties
  @properties
end

Instance Method Details

#ack(options = {}) ⇒ Object



271
272
273
# File 'lib/hot_bunnies/queue.rb', line 271

def ack(options={})
  @channel.basic_ack(delivery_tag, options.fetch(:multiple, false))
end

#reject(options = {}) ⇒ Object



275
276
277
# File 'lib/hot_bunnies/queue.rb', line 275

def reject(options={})
  @channel.basic_reject(delivery_tag, options.fetch(:requeue, false))
end