Class: Jubatus::Common::TNullable

Inherits:
Object
  • Object
show all
Defined in:
lib/jubatus/common/types.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ TNullable

Returns a new instance of TNullable.


101
102
103
# File 'lib/jubatus/common/types.rb', line 101

def initialize(type)
  @type = type
end

Instance Method Details

#from_msgpack(m) ⇒ Object


105
106
107
108
109
110
111
# File 'lib/jubatus/common/types.rb', line 105

def from_msgpack(m)
  if m.nil?
    return nil
  else
    @type.from_msgpack(m)
  end
end

#to_msgpack(m) ⇒ Object


113
114
115
116
117
118
119
# File 'lib/jubatus/common/types.rb', line 113

def to_msgpack(m)
  if m.nil?
    nil
  else
    @type.to_msgpack(m)
  end
end