class TimeBoots::YearBoot
Public Class Methods
new()
click to toggle source
Calls superclass method
TimeBoots::Boot::new
# File lib/time_boots/boot/year.rb, line 4 def initialize super(:year) end
Public Instance Methods
measure(from, to)
click to toggle source
# 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
Protected Instance Methods
_advance(tm, steps)
click to toggle source
# File lib/time_boots/boot/year.rb, line 18 def _advance(tm, steps) generate(tm, year: tm.year + steps) end
_decrease(tm, steps)
click to toggle source
# File lib/time_boots/boot/year.rb, line 22 def _decrease(tm, steps) generate(tm, year: tm.year - steps) end