class Sommelier::Preference
Simple class to bind a score (useable for ranking/sorting) to a generic object.
Attributes
object[R]
score[R]
Public Class Methods
new(object, score)
click to toggle source
# File lib/sommelier/preference.rb, line 7 def initialize(object, score) @object = object @score = score end
Public Instance Methods
>(other)
click to toggle source
Items used in DescendingInsertionSortArray
must implement `>`
# File lib/sommelier/preference.rb, line 13 def >(other) score > other.score end