Class: PgVerify::Interpret::TransitionContext
- Inherits:
-
Object
- Object
- PgVerify::Interpret::TransitionContext
- Defined in:
- lib/pg-verify/interpret/transition_context.rb
Defined Under Namespace
Classes: TempExpression
Instance Attribute Summary collapse
-
#action(str) ⇒ Object
Strings for the guars, actions and preconditions.
-
#guard(str) ⇒ Object
Strings for the guars, actions and preconditions.
-
#parent_component ⇒ Object
Back-reference to the component which owns this transition.
-
#precon(str) ⇒ Object
Strings for the guars, actions and preconditions.
-
#source_location ⇒ Object
Source location for this transition.
-
#src_state ⇒ Object
Source and target states as symbols.
-
#tgt_state ⇒ Object
Source and target states as symbols.
Instance Method Summary collapse
-
#initialize(parent_component, src_state, tgt_state) ⇒ TransitionContext
constructor
A new instance of TransitionContext.
- #to_model ⇒ Object
Constructor Details
#initialize(parent_component, src_state, tgt_state) ⇒ TransitionContext
Returns a new instance of TransitionContext.
20 21 22 23 24 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 20 def initialize(parent_component, src_state, tgt_state) @parent_component = parent_component @src_state, @tgt_state = src_state, tgt_state @source_location = @parent_component.parent_graph.parent_script.find_source_location() end |
Instance Attribute Details
#action(str) ⇒ Object
Strings for the guars, actions and preconditions
15 16 17 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 15 def action @action end |
#guard(str) ⇒ Object
Strings for the guars, actions and preconditions
15 16 17 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 15 def guard @guard end |
#parent_component ⇒ Object
Back-reference to the component which owns this transition
9 10 11 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 9 def parent_component @parent_component end |
#precon(str) ⇒ Object
Strings for the guars, actions and preconditions
15 16 17 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 15 def precon @precon end |
#source_location ⇒ Object
Source location for this transition
18 19 20 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 18 def source_location @source_location end |
#src_state ⇒ Object
Source and target states as symbols
12 13 14 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 12 def src_state @src_state end |
#tgt_state ⇒ Object
Source and target states as symbols
12 13 14 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 12 def tgt_state @tgt_state end |
Instance Method Details
#to_model ⇒ Object
47 48 49 |
# File 'lib/pg-verify/interpret/transition_context.rb', line 47 def to_model() Model::Transition.new(@src_state, @tgt_state, action: @action, precon: @precon, guard: @guard) end |