Sha256: a7882d09dbe799ad55b5152153bbbb49c8c45869043f4d82cd1a4df16bc4e05d

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 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

1 entries across 1 versions & 1 rubygems

Version Path
paymill-0.2.0 lib/paymill/operations/all.rb