Class: GV::Node

Inherits:
Component show all
Defined in:
lib/gv.rb

Overview

Represents a node in the graph

Instance Attribute Summary

Attributes inherited from Component

#graph

Instance Method Summary collapse

Methods inherited from Component

#==, #[], #[]=, #hash, #html, #name

Constructor Details

#initialize(graph, name_or_ptr) ⇒ Node

Returns a new instance of Node.



121
122
123
124
125
126
127
128
129
130
# File 'lib/gv.rb', line 121

def initialize(graph, name_or_ptr)
  @graph = graph
  @ptr =
    case name_or_ptr
    when String
      Libcgraph.agnode(graph.ptr, name_or_ptr, 1)
    else
      name_or_ptr
    end
end