Class: HybridForest::Forests::GrowerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/hybridforest/forests/grower_factory.rb

Constant Summary collapse

TYPES =
{
  cart: HybridForest::Forests::ForestGrowers::CARTGrower,
  id3: HybridForest::Forests::ForestGrowers::ID3Grower,
  hybrid: HybridForest::Forests::ForestGrowers::HybridGrower
}.freeze

Class Method Summary collapse

Class Method Details

.defaultObject



19
20
21
# File 'lib/hybridforest/forests/grower_factory.rb', line 19

def default
  HybridForest::Forests::ForestGrowers::HybridGrower
end

.for(type) ⇒ Object



15
16
17
# File 'lib/hybridforest/forests/grower_factory.rb', line 15

def for(type)
  (TYPES[type] || default).new
end

.typesObject



23
24
25
# File 'lib/hybridforest/forests/grower_factory.rb', line 23

def types
  TYPES.keys
end