Class: Nestful::Response::Headers

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

Instance Method Summary collapse

Constructor Details

#initialize(header = {}) ⇒ Headers

Returns a new instance of Headers.


8
9
10
# File 'lib/nestful/response/headers.rb', line 8

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


20
21
22
23
24
25
26
# File 'lib/nestful/response/headers.rb', line 20

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


12
13
14
# File 'lib/nestful/response/headers.rb', line 12

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

#inspectObject


16
17
18
# File 'lib/nestful/response/headers.rb', line 16

def inspect
  @header.inspect
end

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)

28
29
30
# File 'lib/nestful/response/headers.rb', line 28

def respond_to?(method)
  super || @header.respond_to?(method)
end