lib/kentaa/api/resources/donations.rb in kentaa-api-0.2.1 vs lib/kentaa/api/resources/donations.rb in kentaa-api-0.3.0
- old
+ new
@@ -1,26 +1,31 @@
# frozen_string_literal: true
module Kentaa
module Api
module Resources
- class Donations < Base
+ class Donations < List
include Enumerable
- include Kentaa::Api::Resources::Pagination
def each(&block)
donations.each(&block)
end
+ protected
+
+ def load_resource(options)
+ request.get("/donations", options)
+ end
+
private
def donations
@donations ||= begin
donations = []
if data
data.each do |donation|
- donations << Kentaa::Api::Resources::Donation.new(config, donation)
+ donations << Kentaa::Api::Resources::Donation.new(config, data: donation)
end
end
donations
end