Class: UseCase
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#stereotypes ⇒ Object
readonly
Returns the value of attribute stereotypes.
-
#tagged_values ⇒ Object
readonly
Returns the value of attribute tagged_values.
Attributes inherited from Tag
Instance Method Summary collapse
- #activity_graphs ⇒ Object
- #activity_graphs_by_name(name) ⇒ Object
- #full_name ⇒ Object
-
#initialize(xml, parent_tag) ⇒ UseCase
constructor
UML:CallEvent.
- #signal_event_by_name(name) ⇒ Object
- #signal_events ⇒ Object
- #stereotype_by_name(name) ⇒ Object
- #tagged_value_by_name(tagged_value_name) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Tag
Constructor Details
#initialize(xml, parent_tag) ⇒ UseCase
UML:CallEvent
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/xmimodel/use_case.rb', line 20 def initialize(xml, parent_tag) super(xml, parent_tag) @package = parent_tag.parent_tag @name = xml.attribute("name").to_s if XmiHelper.has_namespace?(xml) namespace = XmiHelper.namespace(xml) @namespace = Namespace.new(namespace, self) unless namespace.nil? end @stereotypes = Array.new XmiHelper.stereotypes(xml).each do |uml_stereotype| stereotype = Stereotype.new(uml_stereotype, self) @stereotypes << stereotype end @tagged_values = Array.new XmiHelper.tagged_values(xml).each do |uml_tagged_value| tagged_value = TaggedValue.new(uml_tagged_value, self) @tagged_values << tagged_value end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/xmimodel/use_case.rb', line 13 def name @name end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
11 12 13 |
# File 'lib/xmimodel/use_case.rb', line 11 def package @package end |
#stereotypes ⇒ Object (readonly)
Returns the value of attribute stereotypes.
15 16 17 |
# File 'lib/xmimodel/use_case.rb', line 15 def stereotypes @stereotypes end |
#tagged_values ⇒ Object (readonly)
Returns the value of attribute tagged_values.
16 17 18 |
# File 'lib/xmimodel/use_case.rb', line 16 def tagged_values @tagged_values end |
Instance Method Details
#activity_graphs ⇒ Object
45 46 47 48 |
# File 'lib/xmimodel/use_case.rb', line 45 def activity_graphs return Array.new if @namespace.nil? @namespace.activity_graphs end |
#activity_graphs_by_name(name) ⇒ Object
50 51 52 53 54 |
# File 'lib/xmimodel/use_case.rb', line 50 def activity_graphs_by_name(name) activity_graph = activity_graphs.select{|obj| obj.name == name} return activity_graph[0] if !activity_graph.nil? && activity_graph.size > 0 nil end |
#full_name ⇒ Object
79 80 81 |
# File 'lib/xmimodel/use_case.rb', line 79 def full_name "#{package.full_name}.#{name}" end |
#signal_event_by_name(name) ⇒ Object
56 57 58 59 60 |
# File 'lib/xmimodel/use_case.rb', line 56 def signal_event_by_name(name) signal_event = signal_events.select{|obj| obj.name == name} return signal_event[0] if !signal_event.nil? && signal_event.size > 0 nil end |
#signal_events ⇒ Object
62 63 64 65 |
# File 'lib/xmimodel/use_case.rb', line 62 def signal_events return Array.new if @namespace.nil? @namespace.signal_events end |
#stereotype_by_name(name) ⇒ Object
67 68 69 70 71 |
# File 'lib/xmimodel/use_case.rb', line 67 def stereotype_by_name(name) stereotype = @stereotypes.select{|s| s.name == name} return stereotype[0] if !stereotype.nil? && stereotype.size > 0 nil end |
#tagged_value_by_name(tagged_value_name) ⇒ Object
73 74 75 76 77 |
# File 'lib/xmimodel/use_case.rb', line 73 def tagged_value_by_name(tagged_value_name) tagged_value = @tagged_values.select{|t| t.name == tagged_value_name} return tagged_value[0] if !tagged_value.nil? && tagged_value.size > 0 nil end |
#to_s ⇒ Object
83 84 85 |
# File 'lib/xmimodel/use_case.rb', line 83 def to_s "UseCase[#{full_name}]" end |