Class: ExpireMe::Response
- Inherits:
-
Object
- Object
- ExpireMe::Response
- Defined in:
- lib/expire_me/response.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(h = { :adapter => nil, :seconds => 0, :http_response => nil }) ⇒ Response
constructor
A new instance of Response.
- #method_missing(t) ⇒ Object
Constructor Details
#initialize(h = { :adapter => nil, :seconds => 0, :http_response => nil }) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/expire_me/response.rb', line 6 def initialize(h={ :adapter => nil, :seconds => 0, :http_response => nil }) self.hash = h adapter.set_expiration(http_response, seconds) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(t) ⇒ Object
11 12 13 |
# File 'lib/expire_me/response.rb', line 11 def method_missing(t) hash[t] end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
4 5 6 |
# File 'lib/expire_me/response.rb', line 4 def hash @hash end |