Class: DoubleEntry::BalanceCalculator::Options Private
- Inherits:
-
Object
- Object
- DoubleEntry::BalanceCalculator::Options
- Defined in:
- lib/double_entry/balance_calculator.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 Attribute Summary collapse
- #account ⇒ Object readonly private
- #at ⇒ Object readonly private
- #codes ⇒ Object readonly private
- #from ⇒ Object readonly private
- #scope ⇒ Object readonly private
- #to ⇒ Object readonly private
Instance Method Summary collapse
- #at? ⇒ Boolean private
- #between? ⇒ Boolean private
- #code? ⇒ Boolean private
-
#initialize(account, args = {}) ⇒ Options
constructor
private
A new instance of Options.
- #scope? ⇒ Boolean private
Constructor Details
#initialize(account, args = {}) ⇒ Options
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.
Returns a new instance of Options.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/double_entry/balance_calculator.rb', line 54 def initialize(account, args = {}) if account.is_a? Symbol @account = account.to_s @scope = args[:scope].present? ? args[:scope].id.to_s : nil else @account = account.identifier.to_s @scope = account.scope_identity end @codes = (args[:codes].to_a << args[:code]).compact @from = args[:from] @to = args[:to] @at = args[:at] end |
Instance Attribute Details
#account ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def account @account end |
#at ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def at @at end |
#codes ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def codes @codes end |
#from ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def from @from end |
#scope ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def scope @scope end |
#to ⇒ Object (readonly)
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.
52 53 54 |
# File 'lib/double_entry/balance_calculator.rb', line 52 def to @to end |
Instance Method Details
#at? ⇒ Boolean
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.
68 69 70 |
# File 'lib/double_entry/balance_calculator.rb', line 68 def at? !!at end |
#between? ⇒ Boolean
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.
72 73 74 |
# File 'lib/double_entry/balance_calculator.rb', line 72 def between? !!(from && to && !at?) end |
#code? ⇒ Boolean
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.
76 77 78 |
# File 'lib/double_entry/balance_calculator.rb', line 76 def code? codes.present? end |
#scope? ⇒ Boolean
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.
80 81 82 |
# File 'lib/double_entry/balance_calculator.rb', line 80 def scope? !!scope end |