Class: InterestDays::Calculation::Base
- Inherits:
-
Object
- Object
- InterestDays::Calculation::Base
- Defined in:
- lib/interest_days/calculation/base.rb
Overview
Base calculation class
Direct Known Subclasses
IcmaActAct, IsdaAct360, IsdaAct364, IsdaAct365, IsdaActAct, ThirtyThreesixtyBase
Instance Attribute Summary collapse
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
- #day_count_factor ⇒ Object
-
#initialize(start_date:, end_date:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(start_date:, end_date:) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 21 |
# File 'lib/interest_days/calculation/base.rb', line 16 def initialize(start_date:, end_date:) @start_date = start_date @end_date = end_date raise StartDateBeforeEndDateError if start_date_after_end_date? end |
Instance Attribute Details
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
14 15 16 |
# File 'lib/interest_days/calculation/base.rb', line 14 def end_date @end_date end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
14 15 16 |
# File 'lib/interest_days/calculation/base.rb', line 14 def start_date @start_date end |
Instance Method Details
#day_count_factor ⇒ Object
23 24 25 |
# File 'lib/interest_days/calculation/base.rb', line 23 def day_count_factor raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}" end |