Class: UML::Graphviz::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/uml/graphviz_helper.rb

Direct Known Subclasses

ClassNode

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



60
61
62
# File 'lib/uml/graphviz_helper.rb', line 60

def attributes
  @attributes
end

#nameObject (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