Class: CircuitBreaker::WorkflowBuilder::DSL::TransitionBuilder
- Inherits:
-
Object
- Object
- CircuitBreaker::WorkflowBuilder::DSL::TransitionBuilder
- Defined in:
- lib/circuit_breaker/workflow_dsl.rb
Instance Attribute Summary collapse
-
#action_context ⇒ Object
Returns the value of attribute action_context.
-
#from_state ⇒ Object
Returns the value of attribute from_state.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rules ⇒ Object
Returns the value of attribute rules.
-
#to_state ⇒ Object
Returns the value of attribute to_state.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(name, from_state, to_state) ⇒ TransitionBuilder
constructor
A new instance of TransitionBuilder.
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_context ⇒ Object
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_state ⇒ Object
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 |
#name ⇒ Object
Returns the value of attribute name.
208 209 210 |
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208 def name @name end |
#rules ⇒ Object
Returns the value of attribute rules.
208 209 210 |
# File 'lib/circuit_breaker/workflow_dsl.rb', line 208 def rules @rules end |
#to_state ⇒ Object
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
#build ⇒ Object
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 |