Module: YPetri::Simulation::TransitionRepresentation::Types
- Included in:
- YPetri::Simulation::TransitionRepresentation
- Defined in:
- lib/y_petri/simulation/transition_representation/types.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
The transition’s type.
Instance Method Summary collapse
-
#Ts? ⇒ Boolean
Is this a Ts transition?.
-
#TS? ⇒ Boolean
Is this a TS transition?.
-
#ts? ⇒ Boolean
Is this a ts transition?.
-
#tS? ⇒ Boolean
Is this a tS transition?.
- #type_init(*args) ⇒ Object
Instance Attribute Details
#type ⇒ Object (readonly)
The transition’s type.
33 34 35 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 33 def type @type end |
Instance Method Details
#Ts? ⇒ Boolean
Is this a Ts transition?
46 47 48 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 46 def Ts? type == :Ts end |
#TS? ⇒ Boolean
Is this a TS transition?
40 41 42 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 40 def TS? type == :TS end |
#ts? ⇒ Boolean
Is this a ts transition?
58 59 60 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 58 def ts? type == :ts end |
#tS? ⇒ Boolean
Is this a tS transition?
52 53 54 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 52 def tS? type == :tS end |
#type_init(*args) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 20 def type_init *args extend case source.type when :A then Type_A when :TS then Type_TS when :Ts then Type_Ts when :tS then Type_tS when :ts then Type_ts else fail TypeError, "Unknown tr. type #{source.type}!" end init end |