Class: Avmtrf1::Forponto::User::Balance::MyBalance
- Inherits:
-
Object
- Object
- Avmtrf1::Forponto::User::Balance::MyBalance
- Defined in:
- lib/avmtrf1/forponto/user/balance.rb
Defined Under Namespace
Classes: AttrConsumer
Instance Attribute Summary collapse
-
#credito ⇒ Object
Returns the value of attribute credito.
-
#debito ⇒ Object
Returns the value of attribute debito.
-
#lost ⇒ Object
Returns the value of attribute lost.
-
#month ⇒ Object
Returns the value of attribute month.
Instance Method Summary collapse
- #after_trigger ⇒ Object
- #after_trigger_acum ⇒ Object
- #consume(previous) ⇒ Object
-
#initialize(month) ⇒ MyBalance
constructor
A new instance of MyBalance.
- #mark_lost ⇒ Object
Constructor Details
#initialize(month) ⇒ MyBalance
Returns a new instance of MyBalance.
65 66 67 68 69 70 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 65 def initialize(month) @month = month @debito = AttrConsumer.new(self, false, month.debito) @credito = AttrConsumer.new(self, true, month.credito) @lost = false end |
Instance Attribute Details
#credito ⇒ Object
Returns the value of attribute credito.
63 64 65 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 63 def credito @credito end |
#debito ⇒ Object
Returns the value of attribute debito.
63 64 65 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 63 def debito @debito end |
#lost ⇒ Object
Returns the value of attribute lost.
63 64 65 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 63 def lost @lost end |
#month ⇒ Object
Returns the value of attribute month.
63 64 65 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 63 def month @month end |
Instance Method Details
#after_trigger ⇒ Object
72 73 74 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 72 def after_trigger credito.after_trigger - debito.after_trigger end |
#after_trigger_acum ⇒ Object
76 77 78 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 76 def after_trigger_acum credito.after_trigger_acum - debito.after_trigger_acum end |
#consume(previous) ⇒ Object
86 87 88 89 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 86 def consume(previous) debito.consume_from_months(previous) credito.consume_from_months(previous) end |
#mark_lost ⇒ Object
80 81 82 |
# File 'lib/avmtrf1/forponto/user/balance.rb', line 80 def mark_lost @lost = true end |