class GV::Component

Attributes

graph[R]

@return [Graph, SubGraph] the graph this component belongs to

ptr[R]

Public Instance Methods

==(other) click to toggle source
# File lib/gv.rb, line 89
def ==(other)
  other.is_a?(Component) && ptr == other.ptr
end
Also aliased as: eql?
[](attr) click to toggle source

Retrieves the value of an attribute @param attr [Symbol, String] attribute name @see www.graphviz.org/doc/info/attrs.html Node, Edge and Graph Attributes @return [Object] the attribute value

# File lib/gv.rb, line 112
def [](attr)
  LibCGraph.agget(ptr, attr.to_s)
end
[]=(attr, value) click to toggle source

Sets an attribute @param attr [Symbol, String] attribute name @see www.graphviz.org/doc/info/attrs.html Node, Edge and Graph Attributes @param value [Object] attribute value

# File lib/gv.rb, line 104
def []=(attr, value)
  LibCGraph.agsafeset(ptr, attr.to_s, value.to_s, "")
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/gv.rb, line 85
def hash
  ptr.hash
end
html(string) click to toggle source

Creates an HTML label @param string [String] the HTML to parse @return [Object] a HTML label

# File lib/gv.rb, line 77
def html(string)
  ptr = LibCGraph.agstrdup_html(graph.ptr, string)
  string = ptr.read_string
  LibCGraph.agstrfree graph.ptr, ptr

  string
end
name() click to toggle source

@return [String] the component's name

# File lib/gv.rb, line 96
def name
  LibCGraph.agnameof ptr
end