Class: TimeBoots::YearBoot
Constant Summary
Constants included from TimeBoots
Instance Attribute Summary
Attributes inherited from Boot
Instance Method Summary collapse
-
#initialize ⇒ YearBoot
constructor
A new instance of YearBoot.
- #measure(from, to) ⇒ Object
Methods inherited from Boot
#advance, #ceil, #decrease, #floor, get, #jump, #lace, #measure_rem, #range, #range_back, #round, #round?, steps
Methods included from TimeBoots
#advance, #ceil, #day, #decrease, #floor, #hour, #jump, #lace, #min, #month, #range, #range_back, #round, #round?, #sec, #steps, #week, #year
Constructor Details
#initialize ⇒ YearBoot
Returns a new instance of YearBoot.
4 5 6 |
# File 'lib/time_boots/boot/year.rb', line 4 def initialize super(:year) end |
Instance Method Details
#measure(from, to) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/time_boots/boot/year.rb', line 8 def measure(from, to) if generate(from, year: to.year) < to to.year - from.year else to.year - from.year - 1 end end |