class Jubatus::NearestNeighbor::IdWithScore
Constants
- TYPE
Attributes
id[R]
score[R]
Public Class Methods
from_msgpack(m)
click to toggle source
# File lib/jubatus/nearest_neighbor/types.rb, line 25 def IdWithScore.from_msgpack(m) val = TYPE.from_msgpack(m) IdWithScore.new(*val) end
new(id, score)
click to toggle source
# File lib/jubatus/nearest_neighbor/types.rb, line 15 def initialize(id, score) @id = id @score = score end
Public Instance Methods
to_msgpack(out = '')
click to toggle source
# File lib/jubatus/nearest_neighbor/types.rb, line 20 def to_msgpack(out = '') t = [@id, @score] return TYPE.to_msgpack(t) end
to_s()
click to toggle source
# File lib/jubatus/nearest_neighbor/types.rb, line 30 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("id_with_score") gen.add("id", @id) gen.add("score", @score) gen.close() return gen.to_s end