Sha256: b0d0a728980169f0a322292ddb2ad4a3fdd8984e93b6a0dcdddeae5432153176

Contents?: true

Size: 778 Bytes

Versions: 3

Compression:

Stored size: 778 Bytes

Contents

module PensioAPI
  class FundingList
    attr_reader :filename
    attr_reader :amount
    attr_reader :acquirer
    attr_reader :funding_date
    attr_reader :created_at
    attr_reader :download_link

    def self.all(options={})
      request = Request.new('/merchant/API/fundingList', options)
      Responses::FundingList.new(request)
    end

    def initialize(funding_list_body)
      @raw = funding_list_body

      @filename = @raw['Filename']
      @amount = @raw['Amount']
      @acquirer = @raw['Acquirer']
      @funding_date = Date.parse(@raw['FundingDate'])
      @created_at = Date.parse(@raw['CreatedDate'])
      @download_link = @raw['DownloadLink']
    end

    def download
      @result ||= FundingListRequest.new(@download_link).result
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pensio_api-0.3.0 lib/pensio_api/funding_list.rb
pensio_api-0.2.3 lib/pensio_api/funding_list.rb
pensio_api-0.2.2 lib/pensio_api/funding_list.rb