Class: CGIParty::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/cgi_party/response.rb

Direct Known Subclasses

AuthenticateResponse, CollectResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_data) ⇒ Response

Returns a new instance of Response.



5
6
7
8
# File 'lib/cgi_party/response.rb', line 5

def initialize(source_data)
  @source_data = source_data
  @received_at = Time.now
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



10
11
12
13
# File 'lib/cgi_party/response.rb', line 10

def method_missing(method_name, *args, &block)
  return fetch_value(method_name) if key_present?(method_name)
  super
end

Instance Attribute Details

#received_atObject (readonly)

Returns the value of attribute received_at.



3
4
5
# File 'lib/cgi_party/response.rb', line 3

def received_at
  @received_at
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/cgi_party/response.rb', line 15

def respond_to_missing?(method_name, include_private = false)
  key_present?(method_name) || super
end