Class: Mxrb::Dsl::ScheduledEventBuilder
- Inherits:
-
Object
- Object
- Mxrb::Dsl::ScheduledEventBuilder
- Defined in:
- lib/mxrb/dsl/builder.rb
Constant Summary collapse
- INTERVAL_UNITS =
{ milliseconds: "Millisecond", seconds: "Second", minutes: "Minute", hours: "Hour", days: "Day", weeks: "Week", months: "Month", years: "Year" }.freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #documentation(d) ⇒ Object
-
#initialize(name, microflow:, interval: 1, unit: :days, enabled: true) ⇒ ScheduledEventBuilder
constructor
A new instance of ScheduledEventBuilder.
- #to_h ⇒ Object
Constructor Details
#initialize(name, microflow:, interval: 1, unit: :days, enabled: true) ⇒ ScheduledEventBuilder
Returns a new instance of ScheduledEventBuilder.
689 690 691 692 693 694 695 696 |
# File 'lib/mxrb/dsl/builder.rb', line 689 def initialize(name, microflow:, interval: 1, unit: :days, enabled: true) @name = name.to_s @microflow = microflow.to_s @interval = interval.to_i @unit = unit.to_sym @enabled = enabled @doc = "" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
687 688 689 |
# File 'lib/mxrb/dsl/builder.rb', line 687 def name @name end |
Instance Method Details
#documentation(d) ⇒ Object
698 |
# File 'lib/mxrb/dsl/builder.rb', line 698 def documentation(d) = (@doc = d) |
#to_h ⇒ Object
700 701 702 703 704 705 |
# File 'lib/mxrb/dsl/builder.rb', line 700 def to_h { name: @name, microflow: @microflow, interval: @interval, unit: @unit, enabled: @enabled, documentation: @doc } end |