Class: Vantiv::Certification::ResponseCache

Inherits:
Object
  • Object
show all
Defined in:
lib/vantiv/certification/response_cache.rb

Instance Method Summary collapse

Constructor Details

#initializeResponseCache

Returns a new instance of ResponseCache.



4
5
6
# File 'lib/vantiv/certification/response_cache.rb', line 4

def initialize
  @responses = {}
end

Instance Method Details

#access_value(values_tree) ⇒ Object



12
13
14
15
16
17
# File 'lib/vantiv/certification/response_cache.rb', line 12

def access_value(values_tree)
  cert_name = values_tree.shift
  response = @responses[cert_name]
  method_chain = values_tree.join('.')
  response.instance_eval(method_chain)
end

#push(cert_name, response) ⇒ Object



8
9
10
# File 'lib/vantiv/certification/response_cache.rb', line 8

def push(cert_name, response)
  @responses[cert_name] = response
end