Class: HybridForest::Trees::Tests::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/hybridforest/trees/tests/test.rb

Direct Known Subclasses

Equal, EqualOrGreater, Less, NotEqual

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature, value) ⇒ Test

Returns a new instance of Test.



9
10
11
12
# File 'lib/hybridforest/trees/tests/test.rb', line 9

def initialize(feature, value)
  @feature = feature
  @value = value
end

Instance Attribute Details

#featureObject (readonly)

Returns the value of attribute feature.



7
8
9
# File 'lib/hybridforest/trees/tests/test.rb', line 7

def feature
  @feature
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/hybridforest/trees/tests/test.rb', line 7

def value
  @value
end

Instance Method Details

#descriptionObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/hybridforest/trees/tests/test.rb', line 18

def description
  raise NotImplementedError
end

#hashObject



22
23
24
# File 'lib/hybridforest/trees/tests/test.rb', line 22

def hash
  feature.hash ^ value.hash
end

#passed_by?(_instance) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/hybridforest/trees/tests/test.rb', line 14

def passed_by?(_instance)
  raise NotImplementedError
end