Class: HTTParty::Response::Headers

Inherits:
Object
  • Object
show all
Includes:
Net::HTTPHeader
Defined in:
lib/httparty/response/headers.rb

Instance Method Summary collapse

Methods included from Net::HTTPHeader

#digest_auth

Constructor Details

#initialize(header = {}) ⇒ Headers

Returns a new instance of Headers.



6
7
8
# File 'lib/httparty/response/headers.rb', line 6

def initialize(header = {})
  @header = header
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/httparty/response/headers.rb', line 18

def method_missing(name, *args, &block)
  if @header.respond_to?(name)
    @header.send(name, *args, &block)
  else
    super
  end
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/httparty/response/headers.rb', line 10

def ==(other)
  @header == other
end

#inspectObject



14
15
16
# File 'lib/httparty/response/headers.rb', line 14

def inspect
  @header.inspect
end

#respond_to?(method, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/httparty/response/headers.rb', line 26

def respond_to?(method, include_all = false)
  super || @header.respond_to?(method, include_all)
end