Class: Stomper::Headers
- Inherits:
-
Object
- Object
- Stomper::Headers
- 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
-
#to_hash ⇒ Hash
Returns a new
Hash
object associating symbolized header names and their principle values.
Instance Method Details
#to_hash ⇒ Hash
Returns a new Hash
object associating symbolized header names and their principle values.
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 |