class Jubatus::Common::TMap
Public Class Methods
new(key, value)
click to toggle source
# File lib/jubatus/common/types.rb, line 139 def initialize(key, value) @key = key @value = value end
Public Instance Methods
from_msgpack(m)
click to toggle source
# File lib/jubatus/common/types.rb, line 144 def from_msgpack(m) Jubatus::Common.check_type(m, Hash) dic = {} m.each do |k, v| dic[@key.from_msgpack(k)] = @value.from_msgpack(v) end return dic end
to_msgpack(m)
click to toggle source
# File lib/jubatus/common/types.rb, line 153 def to_msgpack(m) Jubatus::Common.check_type(m, Hash) dic = {} m.each do |k, v| dic[@key.to_msgpack(k)] = @value.to_msgpack(v) end return dic end