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
12
13
# File 'lib/moneta/api/response_factory.rb', line 7

def build(response)
  klass = response.keys.first
  data = response.values.first

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