Class: Rviz::Node
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, shape = "box", attrs = {}) ⇒ Node
constructor
A new instance of Node.
- #shape ⇒ Object
-
#to_s ⇒ Object
print out as dot source.
Methods included from Helper
Constructor Details
#initialize(name, shape = "box", attrs = {}) ⇒ Node
Returns a new instance of Node.
4 5 6 7 |
# File 'lib/rviz/node.rb', line 4 def initialize name, shape = "box", attrs = {} @name = name @attrs = {"shape" => shape}.merge attrs end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/rviz/node.rb', line 3 def name @name end |
Instance Method Details
#shape ⇒ Object
9 10 11 |
# File 'lib/rviz/node.rb', line 9 def shape @attrs["shape"] end |
#to_s ⇒ Object
print out as dot source
16 17 18 |
# File 'lib/rviz/node.rb', line 16 def to_s sprintf '%s [%s]', self.quote(@name), self.attrs_to_s end |