Class: Opencdd::CompositionTree

Inherits:
Object
  • Object
show all
Defined in:
lib/opencdd/composition_tree.rb

Defined Under Namespace

Classes: Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ CompositionTree

Returns a new instance of CompositionTree.



50
51
52
# File 'lib/opencdd/composition_tree.rb', line 50

def initialize(database)
  @database = database
end

Instance Attribute Details

#databaseObject (readonly)

Returns the value of attribute database.



48
49
50
# File 'lib/opencdd/composition_tree.rb', line 48

def database
  @database
end

Instance Method Details

#for(klass, max_depth: 10) ⇒ Object



54
55
56
# File 'lib/opencdd/composition_tree.rb', line 54

def for(klass, max_depth: 10)
  build_class_node(klass, Set.new, 0, max_depth)
end