Class: Mxrb::Dsl::ScheduledEventBuilder

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nameObject (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_hObject



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