Class: CircuitBreaker::WorkflowBuilder::DSL::TransitionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/circuit_breaker/workflow_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, from_state, to_state) ⇒ TransitionBuilder

Returns a new instance of TransitionBuilder.



210
211
212
213
214
215
216
# File 'lib/circuit_breaker/workflow_dsl.rb', line 210

def initialize(name, from_state, to_state)
  @name = name
  @from_state = from_state
  @to_state = to_state
  @rules = []
  @action_context = nil
end

Instance Attribute Details

#action_contextObject

Returns the value of attribute action_context.



208
209
210
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208

def action_context
  @action_context
end

#from_stateObject

Returns the value of attribute from_state.



208
209
210
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208

def from_state
  @from_state
end

#nameObject

Returns the value of attribute name.



208
209
210
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208

def name
  @name
end

#rulesObject

Returns the value of attribute rules.



208
209
210
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208

def rules
  @rules
end

#to_stateObject

Returns the value of attribute to_state.



208
209
210
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208

def to_state
  @to_state
end

Instance Method Details

#buildObject



218
219
220
221
222
223
224
225
226
# File 'lib/circuit_breaker/workflow_dsl.rb', line 218

def build
  Transition.new(
    name: @name,
    from_state: @from_state,
    to_state: @to_state,
    rules: @rules,
    action_context: @action_context
  )
end