Class: DoubleEntry::Transfer::Set Private

Inherits:
Array
  • Object
show all
Defined in:
lib/double_entry/transfer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#<<(transfer) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
33
34
35
36
# File 'lib/double_entry/transfer.rb', line 30

def <<(transfer)
  if _find(transfer.from, transfer.to, transfer.code)
    raise DuplicateTransfer.new
  else
    super(transfer)
  end
end

#define(attributes) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/double_entry/transfer.rb', line 16

def define(attributes)
  self << Transfer.new(attributes)
end

#find(from, to, code) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/double_entry/transfer.rb', line 20

def find(from, to, code)
  _find(from.identifier, to.identifier, code)
end

#find!(from, to, code) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:



24
25
26
27
28
# File 'lib/double_entry/transfer.rb', line 24

def find!(from, to, code)
  transfer = find(from, to, code)
  raise TransferNotAllowed.new([from.identifier, to.identifier, code].inspect) unless transfer
  return transfer
end