Class: Stomper::Headers

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/stomper/headers.rb

Overview

Note:

Header names are case sensitive, therefore the names ‘header’ and ‘Header’ will not refer to the same values.

A specialized container for storing header name / value pairs for a Stomp Frame. This container behaves much like a Hash, but is specialized for the Stomp protocol. Header names are always converted into Strings through the use of to_s and may have more than one value associated with them.

Instance Method Summary collapse

Instance Method Details

#to_hashHash

Returns a new Hash object associating symbolized header names and their principle values.

Returns:

  • (Hash)


19
20
21
# File 'lib/stomper/headers.rb', line 19

def to_hash
  to_a.inject({}) { |h, (k,v)| h[k.to_sym] ||= v; h }
end