Class: PgVerify::Model::Component
- Inherits:
-
Object
- Object
- PgVerify::Model::Component
- Defined in:
- lib/pg-verify/model/component.rb
Instance Attribute Summary collapse
-
#init_expression ⇒ Object
A Model::ParsedExpression used as the init expression.
-
#name ⇒ Object
The name of this component as a symbol.
-
#represents_fault ⇒ Object
Flag on whether this component is used to represent a fault.
-
#source_location ⇒ Object
The source location of this components definition.
-
#states ⇒ Object
A list of symbols representing states.
-
#transitions ⇒ Object
A list of transitions between states.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Component
constructor
A new instance of Component.
- #represents_fault? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Component
Returns a new instance of Component.
24 25 26 27 28 29 30 31 |
# File 'lib/pg-verify/model/component.rb', line 24 def initialize(args = {}) @name = ( args[:name] || raise('Blubb') ) @states = ( args[:states] || [] ) @transitions = ( args[:transitions] || [] ) @represents_fault = args[:represents_fault].nil? ? false : args[:represents_fault] @source_location = ( args[:source_location] ) @init_expression = args[:init_expression] end |
Instance Attribute Details
#init_expression ⇒ Object
A Model::ParsedExpression used as the init expression. This expression must hold true initially. It can be used to restrict or set the initial state and variables. Can be left as nil in order to not restrict anything
22 23 24 |
# File 'lib/pg-verify/model/component.rb', line 22 def init_expression @init_expression end |
#name ⇒ Object
The name of this component as a symbol
8 9 10 |
# File 'lib/pg-verify/model/component.rb', line 8 def name @name end |
#represents_fault ⇒ Object
Flag on whether this component is used to represent a fault.
14 15 16 |
# File 'lib/pg-verify/model/component.rb', line 14 def represents_fault @represents_fault end |
#source_location ⇒ Object
The source location of this components definition
16 17 18 |
# File 'lib/pg-verify/model/component.rb', line 16 def source_location @source_location end |
#states ⇒ Object
A list of symbols representing states
10 11 12 |
# File 'lib/pg-verify/model/component.rb', line 10 def states @states end |
#transitions ⇒ Object
A list of transitions between states
12 13 14 |
# File 'lib/pg-verify/model/component.rb', line 12 def transitions @transitions end |
Instance Method Details
#represents_fault? ⇒ Boolean
33 34 35 |
# File 'lib/pg-verify/model/component.rb', line 33 def represents_fault?() return @represents_fault end |