Sha256: 707d8cb797e04100298e635cad2fc2de4f4044f80e6fee0bc4934beb45d368b4

Contents?: true

Size: 432 Bytes

Versions: 2

Compression:

Stored size: 432 Bytes

Contents

module Paymill
  module Operations
    module All
      module ClassMethods
        def all()
          response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/", {})
          results = []
          response["data"].each do |obj|
            results << self.new(obj)
          end
          results
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paymill-0.1.0 lib/paymill/operations/all.rb
paymill-0.0.3 lib/paymill/operations/all.rb