Class: DoubleEntry::Transfer::Set Private
- Inherits:
-
Object
- Object
- DoubleEntry::Transfer::Set
- Extended by:
- Forwardable
- 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
- #all ⇒ Object private
- #define(attributes) ⇒ Object private
- #find(from_account, to_account, code) ⇒ Object private
- #find!(from_account, to_account, code) ⇒ Object private
Instance Method Details
#all ⇒ 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.
51 52 53 |
# File 'lib/double_entry/transfer.rb', line 51 def all backing_collection.values 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.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/double_entry/transfer.rb', line 30 def define(attributes) Transfer.new(attributes).tap do |transfer| key = [transfer.from, transfer.to, transfer.code] if _find(*key) fail DuplicateTransfer else backing_collection[key] = transfer end end end |
#find(from_account, to_account, 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.
41 42 43 |
# File 'lib/double_entry/transfer.rb', line 41 def find(from_account, to_account, code) _find(from_account.identifier, to_account.identifier, code) end |
#find!(from_account, to_account, 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.
45 46 47 48 49 |
# File 'lib/double_entry/transfer.rb', line 45 def find!(from_account, to_account, code) find(from_account, to_account, code).tap do |transfer| fail TransferNotAllowed, [from_account.identifier, to_account.identifier, code].inspect unless transfer end end |