Class: Klomp::Frames::Send

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

Instance Method Summary collapse

Methods inherited from Frame

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

Constructor Details

#initialize(queue, body, hdrs) ⇒ Send

Returns a new instance of Send.



94
95
96
97
98
99
100
# File 'lib/klomp/frames.rb', line 94

def initialize(queue, body, hdrs)
  headers['destination'] = queue
  headers.update(stringify_headers(hdrs).reject { |k,v| %w(destination content-length).include? k })
  headers['content-type'] ||= 'text/plain'
  headers['content-length'] = body.bytesize.to_s
  @body = body
end