Class: LooseTightDictionary::Score
- Inherits:
-
Object
- Object
- LooseTightDictionary::Score
- Defined in:
- lib/loose_tight_dictionary/score.rb
Instance Attribute Summary collapse
-
#str1 ⇒ Object
readonly
Returns the value of attribute str1.
-
#str2 ⇒ Object
readonly
Returns the value of attribute str2.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(str1, str2) ⇒ Score
constructor
A new instance of Score.
- #inspect ⇒ Object
- #to_f ⇒ Object
Constructor Details
#initialize(str1, str2) ⇒ Score
Returns a new instance of Score.
7 8 9 10 |
# File 'lib/loose_tight_dictionary/score.rb', line 7 def initialize(str1, str2) @str1 = str1 @str2 = str2 end |
Instance Attribute Details
#str1 ⇒ Object (readonly)
Returns the value of attribute str1.
5 6 7 |
# File 'lib/loose_tight_dictionary/score.rb', line 5 def str1 @str1 end |
#str2 ⇒ Object (readonly)
Returns the value of attribute str2.
5 6 7 |
# File 'lib/loose_tight_dictionary/score.rb', line 5 def str2 @str2 end |
Instance Method Details
#<=>(other) ⇒ Object
20 21 22 |
# File 'lib/loose_tight_dictionary/score.rb', line 20 def <=>(other) to_f <=> other.to_f end |
#==(other) ⇒ Object
24 25 26 |
# File 'lib/loose_tight_dictionary/score.rb', line 24 def ==(other) to_f == other.to_f end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/loose_tight_dictionary/score.rb', line 16 def inspect %{#<Score: to_f=#{to_f}>} end |
#to_f ⇒ Object
12 13 14 |
# File 'lib/loose_tight_dictionary/score.rb', line 12 def to_f @to_f ||= str1.pair_distance_similar str2 end |