Class: Pione::PNML::AnnotationExtractor
- Inherits:
-
Object
- Object
- Pione::PNML::AnnotationExtractor
- Defined in:
- lib/pione/pnml/annotation-extractor.rb
Instance Method Summary collapse
-
#extract ⇒ Object
Extract annotations from transitions.
-
#initialize(net, option) ⇒ AnnotationExtractor
constructor
A new instance of AnnotationExtractor.
Constructor Details
#initialize(net, option) ⇒ AnnotationExtractor
Returns a new instance of AnnotationExtractor.
4 5 6 7 8 9 10 |
# File 'lib/pione/pnml/annotation-extractor.rb', line 4 def initialize(net, option) @net = net @flow_name = option[:flow_name] || "Main" @package_name = option[:package_name] @editor = option[:editor] @tag = option[:tag] end |
Instance Method Details
#extract ⇒ Object
Extract annotations from transitions.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pione/pnml/annotation-extractor.rb', line 17 def extract package_annotations = [] @net.transitions.each do |transition| if line = extract_annotation(transition) package_annotations << line end end package_annotations << ".@ PackageName :: \"%s\"" % @package_name if @package_name package_annotations << ".@ Editor :: \"%s\"" % @editor if @editor package_annotations << ".@ Tag :: \"%s\"" % @tag if @tag return package_annotations end |