Sha256: 2b8e91f938a351d9db9655bc2d4b46345ab080903a080b3529d2b6b96fc24be4

Contents?: true

Size: 366 Bytes

Versions: 16

Compression:

Stored size: 366 Bytes

Contents

module Moneta
  module Api
    class ResponseFactory
      class << self
        # @param [Savon::Response]
        # @return [Moneta::Api::Responses::*]
        def build(response)
          klass, data = response.to_hash.to_a.first

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
moneta-api-1.12.0 lib/moneta/api/response_factory.rb
moneta-api-1.11.0 lib/moneta/api/response_factory.rb
moneta-api-1.10.0 lib/moneta/api/response_factory.rb
moneta-api-1.9.0 lib/moneta/api/response_factory.rb
moneta-api-1.8.0 lib/moneta/api/response_factory.rb
moneta-api-1.7.0 lib/moneta/api/response_factory.rb
moneta-api-1.6.0 lib/moneta/api/response_factory.rb
moneta-api-1.5.0 lib/moneta/api/response_factory.rb
moneta-api-1.4.0 lib/moneta/api/response_factory.rb
moneta-api-1.3.0 lib/moneta/api/response_factory.rb
moneta-api-1.2.1 lib/moneta/api/response_factory.rb
moneta-api-1.2.0 lib/moneta/api/response_factory.rb
moneta-api-1.1.0 lib/moneta/api/response_factory.rb
moneta-api-1.0.4 lib/moneta/api/response_factory.rb
moneta-api-1.0.3 lib/moneta/api/response_factory.rb
moneta-api-1.0.2 lib/moneta/api/response_factory.rb