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.
770 771 772 773 774 775 776 777 |
# File 'lib/mxrb/dsl/builder.rb', line 770 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.
768 769 770 |
# File 'lib/mxrb/dsl/builder.rb', line 768 def name @name end |
Instance Method Details
#documentation(d) ⇒ Object
779 |
# File 'lib/mxrb/dsl/builder.rb', line 779 def documentation(d) = (@doc = d) |
#to_h ⇒ Object
781 782 783 784 785 786 |
# File 'lib/mxrb/dsl/builder.rb', line 781 def to_h { name: @name, microflow: @microflow, interval: @interval, unit: @unit, enabled: @enabled, documentation: @doc } end |