Class: NatsAsync::Headers

Inherits:
Hash
  • Object
show all
Defined in:
lib/nats_async/message.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrap(values) ⇒ Object



7
8
9
# File 'lib/nats_async/message.rb', line 7

def self.wrap(values)
  new.tap { |headers| values.each { |key, value| headers[key] = value } }
end

Instance Method Details

#[](key) ⇒ Object



11
12
13
14
15
16
# File 'lib/nats_async/message.rb', line 11

def [](key)
  return super if key?(key)

  match = keys.find { |existing| existing.to_s.casecmp?(key.to_s) }
  match ? super(match) : nil
end