class Apibanca::Deposit

Public Class Methods

new(client, bank, source_hash = nil, default = nil, &block) click to toggle source
Calls superclass method Apibanca::ProxyBase::new
# File lib/apibanca/client/deposit.rb, line 15
def initialize(client, bank, source_hash = nil, default = nil, &block)
        super(client, source_hash, default, &block)
        @obj_bank = bank
end

Public Instance Methods

history() click to toggle source
# File lib/apibanca/client/deposit.rb, line 11
def history
        @history ||= load_history
end
load_history() click to toggle source
# File lib/apibanca/client/deposit.rb, line 2
def load_history
        h = obj_client.get obj_bank.url("deposits/#{self.id}/history")
        @history = h.body.map { |d| dv = Apibanca::DepositVersion.new(d); dv.obj_deposit = self; dv }
end
obj_bank() click to toggle source
# File lib/apibanca/client/deposit.rb, line 25
def obj_bank
        @obj_bank
end
remove_references() click to toggle source
Calls superclass method Apibanca::ProxyBase#remove_references
# File lib/apibanca/client/deposit.rb, line 20
def remove_references
        super
        @obj_bank = nil
end
to_s() click to toggle source
# File lib/apibanca/client/deposit.rb, line 7
def to_s
        "(Deposit #{id}) #{self.raw_date} / #{self.psd_type ? self.psd_type : self.raw_comment} / #{self.raw_amount}"
end