class Recommendify::Neighbor
Public Class Methods
new(data)
click to toggle source
# File lib/recommendify/neighbor.rb, line 3 def initialize(data) @data = data end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/recommendify/neighbor.rb, line 15 def <=>(other) other.similarity <=> self.similarity end
item_id()
click to toggle source
# File lib/recommendify/neighbor.rb, line 7 def item_id @data.fetch(:item_id).to_s end
similarity()
click to toggle source
# File lib/recommendify/neighbor.rb, line 11 def similarity @data.fetch(:similarity) end