Class: UML::Graphviz::Node
- Inherits:
-
Object
- Object
- UML::Graphviz::Node
- Defined in:
- lib/uml/graphviz_helper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Node
constructor
A new instance of Node.
- #to_dot(indent = 0) ⇒ Object
Constructor Details
#initialize(name) ⇒ Node
62 63 64 65 |
# File 'lib/uml/graphviz_helper.rb', line 62 def initialize(name) @name = name @attributes = Attributes.new end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
60 61 62 |
# File 'lib/uml/graphviz_helper.rb', line 60 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
60 61 62 |
# File 'lib/uml/graphviz_helper.rb', line 60 def name @name end |
Instance Method Details
#to_dot(indent = 0) ⇒ Object
67 68 69 |
# File 'lib/uml/graphviz_helper.rb', line 67 def to_dot(indent = 0) "#{' ' * indent}#{Graph::name_to_id(name)} #{@attributes.to_dot};" end |