Sha256: ef45e259a90880f48e68eee30eb04a68420105f42a693eed7ca6cc9f9f6f4368

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

Contents

require 'pina/models/petty_cash_disburstment'
require 'pina/collections/petty_cash_disburstment'

module Pina
  class PettyCashDisburstment
    class << self
      def find(gid)
        response = Pina::RestAdapter.get(:petty_cash_disburstments, gid)

        return Pina::Models::PettyCashDisburstment.new(attributes(response)) if
          response.ok?

        response
      end

      def all
        response = Pina::RestAdapter.get(:petty_cash_disburstments)

        return Pina::Collections::PettyCashDisburstment.new(attributes(response)) if
          response.ok?

        response
      end

      private

      def attributes(response)
        response.to_hash.merge(response: response)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pina-0.14.4 lib/pina/petty_cash_disburstment.rb
pina-0.14.3 lib/pina/petty_cash_disburstment.rb
pina-0.14.2 lib/pina/petty_cash_disburstment.rb
pina-0.14.0 lib/pina/petty_cash_disburstment.rb