lib/paymill/operations/all.rb in paymill-0.3.0 vs lib/paymill/operations/all.rb in paymill-0.4.0

- old
+ new

@@ -6,10 +6,15 @@ # # @param [Hash] options Options to pass to the API # @return [Array] The available objects def all(options = {}) response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/", options) + results_from response + end + + private + def results_from(response) results = [] response["data"].each do |obj| results << self.new(obj) end results @@ -17,8 +22,9 @@ end def self.included(base) base.extend(ClassMethods) end + end end end