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.
53 54 55 56 57 58 59 60 |
# File 'lib/double_entry/balance_calculator.rb', line 53 def initialize(account, args = {}) @account = account.identifier.to_s @scope = account.scope_identity @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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
51 52 53 |
# File 'lib/double_entry/balance_calculator.rb', line 51 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.
62 63 64 |
# File 'lib/double_entry/balance_calculator.rb', line 62 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.
66 67 68 |
# File 'lib/double_entry/balance_calculator.rb', line 66 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.
70 71 72 |
# File 'lib/double_entry/balance_calculator.rb', line 70 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.
74 75 76 |
# File 'lib/double_entry/balance_calculator.rb', line 74 def scope? !!scope end |