Class: CGIParty::Response
- Inherits:
-
Object
- Object
- CGIParty::Response
- Defined in:
- lib/cgi_party/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#received_at ⇒ Object
readonly
Returns the value of attribute received_at.
Instance Method Summary collapse
-
#initialize(source_data) ⇒ Response
constructor
A new instance of Response.
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
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_at ⇒ Object (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
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 |