Sha256: 2c59fbd79bb742f52a39097f3c18a9f06eb06a3ca0a34b9164f9916fc55a60d8

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module Kentaa
  module Api
    module Resources
      class Donations < List
        include Enumerable

        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, data: donation)
              end
            end

            donations
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kentaa-api-0.3.2 lib/kentaa/api/resources/donations.rb
kentaa-api-0.3.1 lib/kentaa/api/resources/donations.rb
kentaa-api-0.3.0 lib/kentaa/api/resources/donations.rb