Class: Aquanaut::Node Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/aquanaut/node.rb

Overview

This class is abstract.

Base node class which needs to be inherited for special cases.

Direct Known Subclasses

PageNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNode

Returns a new instance of Node.



11
12
13
# File 'lib/aquanaut/node.rb', line 11

def initialize()
  @adjacency_list = []
end

Instance Attribute Details

#adjacency_listObject (readonly)

Returns the value of attribute adjacency_list.



9
10
11
# File 'lib/aquanaut/node.rb', line 9

def adjacency_list
  @adjacency_list
end

Instance Method Details

#add_edge(successor) ⇒ Object

Implements adjacency with an adjacency list.



17
18
19
# File 'lib/aquanaut/node.rb', line 17

def add_edge(successor)
  @adjacency_list << successor
end