Class: CPEE::Transformation::Node
- Inherits:
-
Object
- Object
- CPEE::Transformation::Node
- Includes:
- Container
- Defined in:
- lib/cpee/transformation/structures.rb
Overview
}}}
Direct Known Subclasses
Constant Summary collapse
- @@niceid =
{}
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#endpoints ⇒ Object
readonly
Returns the value of attribute endpoints.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#incoming ⇒ Object
Returns the value of attribute incoming.
-
#label ⇒ Object
Returns the value of attribute label.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#niceid ⇒ Object
Returns the value of attribute niceid.
-
#outgoing ⇒ Object
Returns the value of attribute outgoing.
-
#script ⇒ Object
Returns the value of attribute script.
-
#script_id ⇒ Object
Returns the value of attribute script_id.
-
#script_type ⇒ Object
Returns the value of attribute script_type.
-
#script_var ⇒ Object
Returns the value of attribute script_var.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #inc_incoming! ⇒ Object
- #inc_outgoing! ⇒ Object
-
#initialize(context, id, type, label, incoming, outgoing) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Methods included from Container
Constructor Details
#initialize(context, id, type, label, incoming, outgoing) ⇒ Node
Returns a new instance of Node.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cpee/transformation/structures.rb', line 43 def initialize(context,id,type,label,incoming,outgoing) @@niceid[context] ||= -1 @niceid = (@@niceid[context] += 1) @id = id @type = type @label = label @endpoints = [] @methods = [] @script = nil @script_type = nil @script_id = nil @script_var = 'result' @arguments = {} @incoming = incoming @outgoing = outgoing @attributes = {} end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
41 42 43 |
# File 'lib/cpee/transformation/structures.rb', line 41 def arguments @arguments end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
41 42 43 |
# File 'lib/cpee/transformation/structures.rb', line 41 def attributes @attributes end |
#endpoints ⇒ Object (readonly)
Returns the value of attribute endpoints.
41 42 43 |
# File 'lib/cpee/transformation/structures.rb', line 41 def endpoints @endpoints end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
40 41 42 |
# File 'lib/cpee/transformation/structures.rb', line 40 def id @id end |
#incoming ⇒ Object
Returns the value of attribute incoming.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def incoming @incoming end |
#label ⇒ Object
Returns the value of attribute label.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def label @label end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
41 42 43 |
# File 'lib/cpee/transformation/structures.rb', line 41 def methods @methods end |
#niceid ⇒ Object
Returns the value of attribute niceid.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def niceid @niceid end |
#outgoing ⇒ Object
Returns the value of attribute outgoing.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def outgoing @outgoing end |
#script ⇒ Object
Returns the value of attribute script.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def script @script end |
#script_id ⇒ Object
Returns the value of attribute script_id.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def script_id @script_id end |
#script_type ⇒ Object
Returns the value of attribute script_type.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def script_type @script_type end |
#script_var ⇒ Object
Returns the value of attribute script_var.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def script_var @script_var end |
#type ⇒ Object
Returns the value of attribute type.
42 43 44 |
# File 'lib/cpee/transformation/structures.rb', line 42 def type @type end |
Instance Method Details
#inc_incoming! ⇒ Object
61 62 63 |
# File 'lib/cpee/transformation/structures.rb', line 61 def inc_incoming! @incoming += 1 end |
#inc_outgoing! ⇒ Object
64 65 66 |
# File 'lib/cpee/transformation/structures.rb', line 64 def inc_outgoing! @outgoing += 1 end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/cpee/transformation/structures.rb', line 68 def to_s "#{@niceid} (#{@label},#{@type})\n" end |