Class: Moneta::Api::ResponseFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/moneta/api/response_factory.rb

Class Method Summary collapse

Class Method Details

.build(response) ⇒ Moneta::Api::Responses::*

Parameters:

  • (Savon::Response)

Returns:



7
8
9
10
11
# File 'lib/moneta/api/response_factory.rb', line 7

def build(response)
  klass, data = response.to_hash.to_a.first

  Object.const_get("Moneta::Api::Responses::#{ klass.to_s.classify }").build(data)
end