Class: Matching::AttributePair
- Inherits:
-
Object
- Object
- Matching::AttributePair
- Defined in:
- lib/matching/attribute_pair.rb
Overview
Defines the comparison of two attributes, one from the “left” class and one from the “right”
Instance Attribute Summary collapse
-
#is_fuzzy ⇒ Object
readonly
Returns the value of attribute is_fuzzy.
-
#left_attr ⇒ Object
readonly
Returns the value of attribute left_attr.
-
#right_attr ⇒ Object
readonly
Returns the value of attribute right_attr.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(left_attr, right_attr, weight, is_fuzzy = false) ⇒ AttributePair
constructor
A new instance of AttributePair.
Constructor Details
#initialize(left_attr, right_attr, weight, is_fuzzy = false) ⇒ AttributePair
Returns a new instance of AttributePair.
8 9 10 11 12 13 14 15 |
# File 'lib/matching/attribute_pair.rb', line 8 def initialize(left_attr, right_attr, weight, is_fuzzy = false) @left_attr = left_attr @right_attr = right_attr @weight = weight @is_fuzzy = is_fuzzy raise "Weight must be > 0.0" unless weight > 0.0 end |
Instance Attribute Details
#is_fuzzy ⇒ Object (readonly)
Returns the value of attribute is_fuzzy.
6 7 8 |
# File 'lib/matching/attribute_pair.rb', line 6 def is_fuzzy @is_fuzzy end |
#left_attr ⇒ Object (readonly)
Returns the value of attribute left_attr.
6 7 8 |
# File 'lib/matching/attribute_pair.rb', line 6 def left_attr @left_attr end |
#right_attr ⇒ Object (readonly)
Returns the value of attribute right_attr.
6 7 8 |
# File 'lib/matching/attribute_pair.rb', line 6 def right_attr @right_attr end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
6 7 8 |
# File 'lib/matching/attribute_pair.rb', line 6 def weight @weight end |