Class: Evoc::InterestingnessMeasure
- Inherits:
-
Object
- Object
- Evoc::InterestingnessMeasure
- Includes:
- Comparable, Logging
- Defined in:
- lib/evoc/interestingness_measure.rb
Instance Attribute Summary collapse
-
#hyper_measure ⇒ Object
Returns the value of attribute hyper_measure.
-
#max ⇒ Object
Returns the value of attribute max.
-
#mid ⇒ Object
Returns the value of attribute mid.
-
#min ⇒ Object
Returns the value of attribute min.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #-@ ⇒ Object
- #<=>(other) ⇒ Object
- #finite? ⇒ Boolean
-
#initialize(type:, min:, mid:, max:, value: nil, hyper_measure: false) ⇒ InterestingnessMeasure
constructor
A new instance of InterestingnessMeasure.
- #to_s ⇒ Object
Methods included from Logging
configure_logger_for, #logger, logger_for, set_level
Constructor Details
#initialize(type:, min:, mid:, max:, value: nil, hyper_measure: false) ⇒ InterestingnessMeasure
Returns a new instance of InterestingnessMeasure.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/evoc/interestingness_measure.rb', line 6 def initialize(type:,min:,mid:,max:,value: nil,hyper_measure: false) @type = type self.min = min self.max = max self.mid = mid self.hyper_measure = hyper_measure if block_given? self.value = yield else self.value = value end end |
Instance Attribute Details
#hyper_measure ⇒ Object
Returns the value of attribute hyper_measure.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def hyper_measure @hyper_measure end |
#max ⇒ Object
Returns the value of attribute max.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def max @max end |
#mid ⇒ Object
Returns the value of attribute mid.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def mid @mid end |
#min ⇒ Object
Returns the value of attribute min.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def min @min end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/evoc/interestingness_measure.rb', line 4 def value @value end |
Instance Method Details
#-@ ⇒ Object
56 57 58 |
# File 'lib/evoc/interestingness_measure.rb', line 56 def -@ -self.value end |
#<=>(other) ⇒ Object
51 52 53 54 |
# File 'lib/evoc/interestingness_measure.rb', line 51 def <=> other return nil unless constr_equal_type other self.value <=> other.value end |
#finite? ⇒ Boolean
60 61 62 |
# File 'lib/evoc/interestingness_measure.rb', line 60 def finite? self.value.finite? end |
#to_s ⇒ Object
64 65 66 |
# File 'lib/evoc/interestingness_measure.rb', line 64 def to_s self.value.to_s end |