Class: SignalEvent
- Inherits:
-
Object
- Object
- SignalEvent
- Defined in:
- lib/xmimodel/signal_event.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#use_case ⇒ Object
readonly
Returns the value of attribute use_case.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(xml, use_case) ⇒ SignalEvent
constructor
A new instance of SignalEvent.
- #parameter_by_name(name) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(xml, use_case) ⇒ SignalEvent
Returns a new instance of SignalEvent.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/xmimodel/signal_event.rb', line 14 def initialize(xml, use_case) @xml = xml @use_case = use_case.parent @id = xml.attribute("xmi:id").to_s @name = xml.attribute("name").to_s @parameters = Array.new XmiHelper.parameters(xml).each do |uml_parameter| parameter = Parameter.new(uml_parameter, self) @parameters << parameter end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/xmimodel/signal_event.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/xmimodel/signal_event.rb', line 8 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
10 11 12 |
# File 'lib/xmimodel/signal_event.rb', line 10 def parameters @parameters end |
#use_case ⇒ Object (readonly)
Returns the value of attribute use_case.
12 13 14 |
# File 'lib/xmimodel/signal_event.rb', line 12 def use_case @use_case end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
5 6 7 |
# File 'lib/xmimodel/signal_event.rb', line 5 def xml @xml end |
Instance Method Details
#full_name ⇒ Object
34 35 36 |
# File 'lib/xmimodel/signal_event.rb', line 34 def full_name "#{use_case.full_name}::#{name}" end |
#parameter_by_name(name) ⇒ Object
28 29 30 31 32 |
# File 'lib/xmimodel/signal_event.rb', line 28 def parameter_by_name(name) parameter = @parameters.select{|obj| obj.name == name} return parameter[0] if !parameter.nil? && parameter.size > 0 nil end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/xmimodel/signal_event.rb', line 38 def to_s "SignalEvent[#{full_name}]" end |