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, #to_s

Constructor Details

#initialize(queue, body, hdrs) ⇒ Send

Returns a new instance of Send.



83
84
85
86
87
88
89
# File 'lib/klomp/frames.rb', line 83

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