Class: DeathAndTaxes::TaxVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/death_and_taxes/tax_version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_onObject (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

#endsObject (readonly)

Returns the value of attribute ends.



3
4
5
# File 'lib/death_and_taxes/tax_version.rb', line 3

def ends
  @ends
end

#percentageObject (readonly)

Returns the value of attribute percentage.



3
4
5
# File 'lib/death_and_taxes/tax_version.rb', line 3

def percentage
  @percentage
end

#startsObject (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

Returns:

  • (Boolean)


11
12
13
# File 'lib/death_and_taxes/tax_version.rb', line 11

def cover? date
  (@starts..@ends).cover? date
end