Class: ModularTree::TreeArray

Inherits:
AbstractTree
  • Object
show all
Includes:
DownTreeAlgorithms
Defined in:
lib/modular_tree/tree_array.rb

Overview

Doesn’t work atm. because DownTreeAlgorithms methods are implemented as members and not as class methods and perhaps because of other stuff

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(array) ⇒ TreeArray

Returns a new instance of TreeArray.



13
14
15
# File 'lib/modular_tree/tree_array.rb', line 13

def initialize(array)
  @array = array
end

Instance Attribute Details

#arrayObject (readonly)

Returns the value of attribute array.



8
9
10
# File 'lib/modular_tree/tree_array.rb', line 8

def array
  @array
end

Class Method Details

.filter(*args) ⇒ Object



17
# File 'lib/modular_tree/tree_array.rb', line 17

def self.filter(*args) = DownTreeAlgorithms.filter(*args)

Instance Method Details

#childrenObject



11
# File 'lib/modular_tree/tree_array.rb', line 11

def children = array[1..-1]

#nodeObject



10
# File 'lib/modular_tree/tree_array.rb', line 10

def node = array.first