lib/moneta/api/response_factory.rb in moneta-api-1.0.1 vs lib/moneta/api/response_factory.rb in moneta-api-1.0.2
- old
+ new
@@ -4,18 +4,11 @@
class << self
# @param [Savon::Response]
# @return [Moneta::Api::Responses::*]
def build(response)
klass, data = response.to_hash.to_a.first
- klass = classify(klass)
- Object.const_get("Moneta::Api::Responses::#{ klass }").build(data)
- end
-
- private
-
- def classify(str)
- str.to_s.split('_').map(&:capitalize).join
+ Object.const_get("Moneta::Api::Responses::#{ klass.to_s.classify }").build(data)
end
end
end
end
end