Class: Postal::HeaderSet

Inherits:
Object
  • Object
show all
Defined in:
lib/postal/header_set.rb

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ HeaderSet

Returns a new instance of HeaderSet.



4
5
6
# File 'lib/postal/header_set.rb', line 4

def initialize(headers)
  @headers = headers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



16
17
18
# File 'lib/postal/header_set.rb', line 16

def method_missing(*args, &block)
  @headers.send(*args, &block)
end

Instance Method Details

#[](name) ⇒ Object



8
9
10
# File 'lib/postal/header_set.rb', line 8

def [](name)
  @headers[name.to_s.downcase]
end

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/postal/header_set.rb', line 12

def has_key?(key)
  @headers.has_key?(name.to_s.downcase)
end