class OpeningHoursConverter::Interval
Attributes
day_end[R]
day_start[R]
end[R]
is_off[R]
start[R]
Public Class Methods
new(day_start, min_start, day_end = 0, min_end = 0, is_off = false)
click to toggle source
# File lib/opening_hours_converter/interval.rb, line 8 def initialize(day_start, min_start, day_end = 0, min_end = 0, is_off = false) @day_start = day_start @day_end = day_end @start = min_start @end = min_end @is_off = is_off if @day_end == 0 && @end == 0 @day_end = DAYS_MAX @end = MINUTES_MAX end end
Public Instance Methods
max?()
click to toggle source
# File lib/opening_hours_converter/interval.rb, line 25 def max? @day_end == DAYS_MAX && @end == MINUTES_MAX end
single_day?()
click to toggle source
# File lib/opening_hours_converter/interval.rb, line 21 def single_day? @day_start == @day_end end
single_day_end_at_midnight?()
click to toggle source
# File lib/opening_hours_converter/interval.rb, line 29 def single_day_end_at_midnight? @day_end == @day_start + 1 && @end == 0 end