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.



127
128
129
130
131
132
# File 'lib/hot_bunnies/queue.rb', line 127

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.



125
126
127
# File 'lib/hot_bunnies/queue.rb', line 125

def channel
  @channel
end

#consumer_tagObject (readonly)

Returns the value of attribute consumer_tag.



125
126
127
# File 'lib/hot_bunnies/queue.rb', line 125

def consumer_tag
  @consumer_tag
end

#envelopeObject (readonly)

Returns the value of attribute envelope.



125
126
127
# File 'lib/hot_bunnies/queue.rb', line 125

def envelope
  @envelope
end

#propertiesObject (readonly)

Returns the value of attribute properties.



125
126
127
# File 'lib/hot_bunnies/queue.rb', line 125

def properties
  @properties
end

Instance Method Details

#ack(options = {}) ⇒ Object



134
135
136
# File 'lib/hot_bunnies/queue.rb', line 134

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

#delivery_tagObject



142
143
144
# File 'lib/hot_bunnies/queue.rb', line 142

def delivery_tag
  @envelope.delivery_tag
end

#reject(options = {}) ⇒ Object



138
139
140
# File 'lib/hot_bunnies/queue.rb', line 138

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

#routing_keyObject



146
147
148
# File 'lib/hot_bunnies/queue.rb', line 146

def routing_key
  @envelope.routing_key
end