Class: Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ Node

Returns a new instance of Node.



3
4
5
6
# File 'lib/rgraph/node.rb', line 3

def initialize(arg)
  @args = arg
  @neighbours = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



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

def method_missing(name, *args)
  super unless args.empty?
  @args[name]
end

Instance Attribute Details

#neighboursObject

Returns the value of attribute neighbours.



2
3
4
# File 'lib/rgraph/node.rb', line 2

def neighbours
  @neighbours
end