Class: ExpireMe::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject

Returns the value of attribute hash.



4
5
6
# File 'lib/expire_me/response.rb', line 4

def hash
  @hash
end