Class: DeathAndTaxes::TaxVersion
- Inherits:
-
Object
- Object
- DeathAndTaxes::TaxVersion
- Defined in:
- lib/death_and_taxes/tax_version.rb
Instance Attribute Summary collapse
-
#apply_on ⇒ Object
readonly
Returns the value of attribute apply_on.
-
#ends ⇒ Object
readonly
Returns the value of attribute ends.
-
#percentage ⇒ Object
readonly
Returns the value of attribute percentage.
-
#starts ⇒ Object
readonly
Returns the value of attribute starts.
Instance Method Summary collapse
- #cover?(date) ⇒ Boolean
-
#initialize(yml) ⇒ TaxVersion
constructor
A new instance of TaxVersion.
Constructor Details
#initialize(yml) ⇒ TaxVersion
Returns a new instance of TaxVersion.
4 5 6 7 8 9 |
# File 'lib/death_and_taxes/tax_version.rb', line 4 def initialize yml @starts = yml['starts'] @ends = yml['ends'] @percentage = yml['percentage'] @apply_on = yml['apply_on'] end |
Instance Attribute Details
#apply_on ⇒ Object (readonly)
Returns the value of attribute apply_on.
3 4 5 |
# File 'lib/death_and_taxes/tax_version.rb', line 3 def apply_on @apply_on end |
#ends ⇒ Object (readonly)
Returns the value of attribute ends.
3 4 5 |
# File 'lib/death_and_taxes/tax_version.rb', line 3 def ends @ends end |
#percentage ⇒ Object (readonly)
Returns the value of attribute percentage.
3 4 5 |
# File 'lib/death_and_taxes/tax_version.rb', line 3 def percentage @percentage end |
#starts ⇒ Object (readonly)
Returns the value of attribute starts.
3 4 5 |
# File 'lib/death_and_taxes/tax_version.rb', line 3 def starts @starts end |
Instance Method Details
#cover?(date) ⇒ Boolean
11 12 13 |
# File 'lib/death_and_taxes/tax_version.rb', line 11 def cover? date (@starts..@ends).cover? date end |