Class: Date

Inherits:
Object
  • Object
show all
Includes:
WeekOfMonth::Day, WeekOfMonth::Month, WeekOfMonth::Week, WeekOfMonth::Year
Defined in:
lib/week_of_month.rb

Constant Summary

Constants included from WeekOfMonth::Constant

WeekOfMonth::Constant::DAYS_IN_SEQUENCE, WeekOfMonth::Constant::MONTH_WITH_DAY, WeekOfMonth::Constant::MONTH_WITH_SEQUENCE, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_ENG, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_FR, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_GER, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_JAP

Instance Method Summary collapse

Methods included from WeekOfMonth::Year

included

Methods included from WeekOfMonth::Week

#beginning_of_week, #const, #current_week, #days_left_in_week, #days_past_in_week, #end_of_week, #first_week?, #general_week_of_month, #last_week?, #next_week, #previous_week, #second_week?, #total_weeks, #week_end?, #week_of_month, #week_split, #working_day?

Methods included from WeekOfMonth::Month

#beginning_of_month, #day_name, #end_of_month, #last_day_of_month, #month_name, #name_of_month

Methods included from WeekOfMonth::Day

#days_array, #name_of_week_day

Instance Method Details

#friday?Boolean

Returns:

  • (Boolean)


27
# File 'lib/week_of_month.rb', line 27

def friday?    ; self.wday == 5; end

#monday?Boolean

Returns:

  • (Boolean)


23
# File 'lib/week_of_month.rb', line 23

def monday?    ; self.wday == 1; end

#saturday?Boolean

Returns:

  • (Boolean)


28
# File 'lib/week_of_month.rb', line 28

def saturday?  ; self.wday == 6; end

#sunday?Boolean

Returns:

  • (Boolean)


22
# File 'lib/week_of_month.rb', line 22

def sunday?    ; self.wday == 0; end

#thursday?Boolean

Returns:

  • (Boolean)


26
# File 'lib/week_of_month.rb', line 26

def thursday?  ; self.wday == 4; end

#to_dateObject



16
17
18
# File 'lib/week_of_month.rb', line 16

def to_date
  ::Date.new(year, month, day)
end

#tuesday?Boolean

Returns:

  • (Boolean)


24
# File 'lib/week_of_month.rb', line 24

def tuesday?   ; self.wday == 2; end

#wednesday?Boolean

Returns:

  • (Boolean)


25
# File 'lib/week_of_month.rb', line 25

def wednesday? ; self.wday == 3; end