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

- (Headers) initialize(header = {})

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

- (Object) method_missing(name, *args, &block)



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

- (Object) ==(other)



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

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

- (Object) inspect



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

def inspect
  @header.inspect
end

- (Boolean) respond_to?(method, include_all = false)

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