Class: Temporalio::Client::Schedule::Spec::Calendar
- Inherits:
-
Object
- Object
- Temporalio::Client::Schedule::Spec::Calendar
- Defined in:
- lib/temporalio/client/schedule.rb
Overview
Specification relative to calendar time when to run an action.
A timestamp matches if at least one range of each field matches except for year. If year is missing, that means all years match. For all fields besides year, at least one range must be present to match anything.
Instance Attribute Summary collapse
-
#comment ⇒ String?
Description of this schedule.
-
#day_of_month ⇒ Array<Range>
Day of month range to match, 1-31.
-
#day_of_week ⇒ Array<Range>
Day of week range to match, 0-6, 0 is Sunday.
-
#hour ⇒ Array<Range>
Hour range to match, 0-23.
-
#minute ⇒ Array<Range>
Minute range to match, 0-59.
-
#month ⇒ Array<Range>
Month range to match, 1-12.
-
#second ⇒ Array<Range>
Second range to match, 0-59.
-
#year ⇒ Array<Range>
Optional year range to match.
Instance Method Summary collapse
-
#initialize(second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil) ⇒ Calendar
constructor
Create a calendar spec.
Constructor Details
#initialize(second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil) ⇒ Calendar
Create a calendar spec.
579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/temporalio/client/schedule.rb', line 579 def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end |
Instance Attribute Details
#comment ⇒ String?
Returns Description of this schedule.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#day_of_month ⇒ Array<Range>
Returns Day of month range to match, 1-31. Default matches all days.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#day_of_week ⇒ Array<Range>
Returns Day of week range to match, 0-6, 0 is Sunday. Default matches all days.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#hour ⇒ Array<Range>
Returns Hour range to match, 0-23. Default matches 0.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#minute ⇒ Array<Range>
Returns Minute range to match, 0-59. Default matches 0.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#month ⇒ Array<Range>
Returns Month range to match, 1-12. Default matches all months.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#second ⇒ Array<Range>
Returns Second range to match, 0-59. Default matches 0.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |
#year ⇒ Array<Range>
Returns Optional year range to match. Default of empty matches all years.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/temporalio/client/schedule.rb', line 554 class Calendar # @!visibility private def self._from_proto(raw_cal) Calendar.new( second: Range._from_protos(raw_cal.second), minute: Range._from_protos(raw_cal.minute), hour: Range._from_protos(raw_cal.hour), day_of_month: Range._from_protos(raw_cal.day_of_month), month: Range._from_protos(raw_cal.month), year: Range._from_protos(raw_cal.year), day_of_week: Range._from_protos(raw_cal.day_of_week), comment: Internal::ProtoUtils.string_or(raw_cal.comment) ) end # Create a calendar spec. # # @param second [Array<Range>] Second range to match, 0-59. Default matches 0. # @param minute [Array<Range>] Minute range to match, 0-59. Default matches 0. # @param hour [Array<Range>] Hour range to match, 0-23. Default matches 0. # @param day_of_month [Array<Range>] Day of month range to match, 1-31. Default matches all days. # @param month [Array<Range>] Month range to match, 1-12. Default matches all months. # @param year [Array<Range>] Optional year range to match. Default of empty matches all years. # @param day_of_week [Array<Range>] Day of week range to match, 0-6, 0 is Sunday. Default matches all days. # @param comment [String, nil] Description of this schedule. def initialize( second: [Range.new(0)], minute: [Range.new(0)], hour: [Range.new(0)], day_of_month: [Range.new(1, 31)], month: [Range.new(1, 12)], year: [], day_of_week: [Range.new(0, 6)], comment: nil ) super end # @!visibility private def _to_proto Api::Schedule::V1::StructuredCalendarSpec.new( second: Range._to_protos(second), minute: Range._to_protos(minute), hour: Range._to_protos(hour), day_of_month: Range._to_protos(day_of_month), month: Range._to_protos(month), year: Range._to_protos(year), day_of_week: Range._to_protos(day_of_week), comment: comment || '' ) end end |