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, #to_s
Constructor Details
#initialize(queue, body, hdrs) ⇒ Send
Returns a new instance of Send.
88 89 90 91 92 93 94 |
# File 'lib/klomp/frames.rb', line 88 def initialize(queue, body, hdrs) headers['destination'] = queue headers.update(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 |