Class: Petri::Place
- Inherits:
-
Object
- Object
- Petri::Place
- Defined in:
- lib/petri/place.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #compile ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(label, options = {}) ⇒ Place
constructor
A new instance of Place.
Constructor Details
#initialize(label, options = {}) ⇒ Place
Returns a new instance of Place.
3 4 5 6 7 8 9 10 11 |
# File 'lib/petri/place.rb', line 3 def initialize(label, ={}) raise TypeError unless label.is_a? Symbol name = [:name] || label.to_s raise TypeError unless name.is_a? String @label = label @name = name end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
2 3 4 |
# File 'lib/petri/place.rb', line 2 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/petri/place.rb', line 2 def name @name end |
Instance Method Details
#compile ⇒ Object
13 14 15 16 17 18 |
# File 'lib/petri/place.rb', line 13 def compile { label: @label, name: @name, } end |