Class: Discordrb::ScheduledEvent::RecurrenceRule::Builder
- Inherits:
-
Object
- Object
- Discordrb::ScheduledEvent::RecurrenceRule::Builder
- Defined in:
- lib/discordrb/data/scheduled_event.rb
Overview
Builder for the reccurence rule.
Instance Attribute Summary collapse
- #frequency ⇒ void writeonly
- #interval ⇒ void writeonly
- #start_time ⇒ void writeonly
Instance Method Summary collapse
-
#by_month=(months) ⇒ void
Set the the specific months of the year to recur on.
-
#by_month_day=(monthly_days) ⇒ void
Set the the specific days within the month to recur on.
-
#by_n_weekday(week:, day:) ⇒ void
Set the specific days for a specific week to recur on.
-
#by_weekday=(weekdays) ⇒ void
Set the specific days of the week to recur on.
Instance Attribute Details
#frequency=(value) ⇒ void (writeonly)
434 435 436 |
# File 'lib/discordrb/data/scheduled_event.rb', line 434 def frequency=(value) @frequency = value end |
#interval=(value) ⇒ void (writeonly)
429 430 431 |
# File 'lib/discordrb/data/scheduled_event.rb', line 429 def interval=(value) @interval = value end |
#start_time=(value) ⇒ void (writeonly)
439 440 441 |
# File 'lib/discordrb/data/scheduled_event.rb', line 439 def start_time=(value) @start_time = value end |
Instance Method Details
#by_month=(months) ⇒ void
This method returns an undefined value.
Set the the specific months of the year to recur on.
460 461 462 |
# File 'lib/discordrb/data/scheduled_event.rb', line 460 def by_month=(months) @by_month = Array(months).map { |month| MONTHS[month] || month } end |
#by_month_day=(monthly_days) ⇒ void
This method returns an undefined value.
Set the the specific days within the month to recur on.
452 453 454 |
# File 'lib/discordrb/data/scheduled_event.rb', line 452 def by_month_day=(monthly_days) @by_month_day = Array(monthly_days).map(&:to_i) end |
#by_n_weekday(week:, day:) ⇒ void
This method returns an undefined value.
Set the specific days for a specific week to recur on.
476 477 478 |
# File 'lib/discordrb/data/scheduled_event.rb', line 476 def by_n_weekday(week:, day:) (@by_n_weekday ||= []) << { n: week, day: WEEKDAYS[day] || day } end |
#by_weekday=(weekdays) ⇒ void
This method returns an undefined value.
Set the specific days of the week to recur on.
468 469 470 |
# File 'lib/discordrb/data/scheduled_event.rb', line 468 def by_weekday=(weekdays) @by_weekday = Array(weekdays).map { |day| WEEKDAYS[day] || day } end |