Class: Klomp::Frames::Subscribe

Inherits:
Frame
  • Object
show all
Defined in:
lib/klomp/frames.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Frame

#[], #[]=, #body, #body=, #dump_headers, #headers, #name, #new_headers, #stringify_headers, #to_s

Constructor Details

#initialize(queue, hdrs = {}) ⇒ Subscribe

Returns a new instance of Subscribe.



105
106
107
108
109
110
# File 'lib/klomp/frames.rb', line 105

def initialize(queue, hdrs = {})
  headers.update(stringify_headers(hdrs).reject { |k,v| %w(destination ack).include? k })
  headers['id'] ||= queue
  headers['destination'] = queue
  headers['ack'] = 'auto'
end

Instance Attribute Details

#previous_subscriberObject

Returns the value of attribute previous_subscriber.



104
105
106
# File 'lib/klomp/frames.rb', line 104

def previous_subscriber
  @previous_subscriber
end