class Biz::WeekTime::Abstract

Attributes

week_minute[R]

Public Class Methods

from_time(time) click to toggle source
# File lib/biz/week_time/abstract.rb, line 11
def self.from_time(time)
  new(
    time.wday * Time.day_minutes +
      time.hour * Time.hour_minutes +
      time.min
  )
end
new(week_minute) click to toggle source
# File lib/biz/week_time/abstract.rb, line 19
def initialize(week_minute)
  @week_minute = Integer(week_minute)
end

Public Instance Methods

wday_symbol() click to toggle source
# File lib/biz/week_time/abstract.rb, line 23
def wday_symbol
  day_of_week.symbol
end

Private Instance Methods

<=>(other) click to toggle source
# File lib/biz/week_time/abstract.rb, line 44
def <=>(other)
  return unless other.is_a?(WeekTime::Abstract)

  week_minute <=> other.week_minute
end