DayOfWeek represents a day of the week in the Gregorian calendar.
time = Time.local(2016, 2, 15)
time.day_of_week # => Time::DayOfWeek::Monday
Each member is identified by its ordinal number starting from Monday = 1
according to ISO 8601.
#value returns this ordinal number. It can easily be converted to the also
common numbering based on Sunday = 0 using value % 7.
Constructors
from_value(value :
Int32) : self
Returns the day of week that has the given value, or raises if no such member exists.
This method also accepts 0 to identify Sunday in order to be compliant
with the Sunday = 0 numbering. All other days are equal in both formats.
SourceInstance methods
friday?
Returns true if this enum value equals Friday
Sourcemonday?
Returns true if this enum value equals Monday
Sourcesaturday?
Returns true if this enum value equals Saturday
Sourcesunday?
Returns true if this enum value equals Sunday
Sourcethursday?
Returns true if this enum value equals Thursday
Sourcetuesday?
Returns true if this enum value equals Tuesday
Sourcewednesday?
Returns true if this enum value equals Wednesday
Source