Class: Node

Inherits:
Object
  • Object
show all
Defined in:
lib/binary-tree-node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, *args) ⇒ Node

Create the tree’s root with the base value x and an unkown number of arguments.



7
8
9
10
# File 'lib/binary-tree-node.rb', line 7

def initialize(x, *args)
  @x    = x
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



3
4
5
# File 'lib/binary-tree-node.rb', line 3

def args
  @args
end

#eastObject

Returns the value of attribute east.



3
4
5
# File 'lib/binary-tree-node.rb', line 3

def east
  @east
end

#westObject

Returns the value of attribute west.



3
4
5
# File 'lib/binary-tree-node.rb', line 3

def west
  @west
end

#xObject (readonly)

Returns the value of attribute x.



2
3
4
# File 'lib/binary-tree-node.rb', line 2

def x
  @x
end