Class: Matching::AttributePair

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_fuzzyObject (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_attrObject (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_attrObject (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

#weightObject (readonly)

Returns the value of attribute weight.



6
7
8
# File 'lib/matching/attribute_pair.rb', line 6

def weight
  @weight
end