Class: Discordrb::ScheduledEvent::RecurrenceRule::WeeklyDay

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data/scheduled_event.rb

Overview

The specific day within a specific week to recur on.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dayInteger (readonly)

Returns the day (0-6) of the week to recur on.

Returns:

  • (Integer)

    the day (0-6) of the week to recur on.



386
387
388
# File 'lib/discordrb/data/scheduled_event.rb', line 386

def day
  @day
end

#weekInteger (readonly)

Returns the week (1-5) to recur on in the month.

Returns:

  • (Integer)

    the week (1-5) to recur on in the month.



389
390
391
# File 'lib/discordrb/data/scheduled_event.rb', line 389

def week
  @week
end

Instance Method Details

#friday?true, false

Returns whether the day within the week is a friday.

Returns:

  • (true, false)

    whether the day within the week is a friday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#monday?true, false

Returns whether the day within the week is a monday.

Returns:

  • (true, false)

    whether the day within the week is a monday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#saturday?true, false

Returns whether the day within the week is a saturday.

Returns:

  • (true, false)

    whether the day within the week is a saturday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#sunday?true, false

Returns whether the day within the week is a sunday.

Returns:

  • (true, false)

    whether the day within the week is a sunday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#thursday?true, false

Returns whether the day within the week is a thursday.

Returns:

  • (true, false)

    whether the day within the week is a thursday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#tuesday?true, false

Returns whether the day within the week is a tuesday.

Returns:

  • (true, false)

    whether the day within the week is a tuesday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end

#wednesday?true, false

Returns whether the day within the week is a wednesday.

Returns:

  • (true, false)

    whether the day within the week is a wednesday.



417
418
419
420
421
# File 'lib/discordrb/data/scheduled_event.rb', line 417

WEEKDAYS.each do |name, value|
  define_method("#{name}?") do
    @day == value
  end
end