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.



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

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.



131
132
133
# File 'lib/hot_bunnies/queue.rb', line 131

def channel
  @channel
end

#consumer_tagObject (readonly)

Returns the value of attribute consumer_tag.



131
132
133
# File 'lib/hot_bunnies/queue.rb', line 131

def consumer_tag
  @consumer_tag
end

#envelopeObject (readonly)

Returns the value of attribute envelope.



131
132
133
# File 'lib/hot_bunnies/queue.rb', line 131

def envelope
  @envelope
end

#propertiesObject (readonly)

Returns the value of attribute properties.



131
132
133
# File 'lib/hot_bunnies/queue.rb', line 131

def properties
  @properties
end

Instance Method Details

#ack(options = {}) ⇒ Object



140
141
142
# File 'lib/hot_bunnies/queue.rb', line 140

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

#delivery_tagObject



148
149
150
# File 'lib/hot_bunnies/queue.rb', line 148

def delivery_tag
  @envelope.delivery_tag
end

#reject(options = {}) ⇒ Object



144
145
146
# File 'lib/hot_bunnies/queue.rb', line 144

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

#routing_keyObject



152
153
154
# File 'lib/hot_bunnies/queue.rb', line 152

def routing_key
  @envelope.routing_key
end