Sha256: c896c65d3046f470c4d577ae8c59c9ad959ecb77b2a78e22a7e6a917ac956f0f

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

module Paymill
  module Operations
    module All
      module ClassMethods
        def all(options = {})
          response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/", options)
          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.2.2 lib/paymill/operations/all.rb
paymill-0.2.1 lib/paymill/operations/all.rb