Class: Klomp::Frames::Send
Instance Method Summary collapse
-
#initialize(queue, body, hdrs) ⇒ Send
constructor
A new instance of Send.
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 |