Class: ProtocolBuffers::Field::Sint32Field

Inherits:
Int32Field show all
Defined in:
lib/protocol_buffers/runtime/field.rb

Instance Attribute Summary

Attributes inherited from ProtocolBuffers::Field

#name, #otype, #tag

Instance Method Summary collapse

Methods inherited from Int32Field

#bits, #max, #min

Methods inherited from VarintField

#valid_type?

Methods included from WireFormats::VARINT

#wire_type

Methods inherited from NumericField

#check_value, #default_value, #max, #min

Methods inherited from ProtocolBuffers::Field

#add_methods_to, #check_valid, #check_value, create, #initialize, #inspect_value, #repeated?, #valid_type?

Instance Method Details

#deserialize(value) ⇒ Object



375
376
377
# File 'lib/protocol_buffers/runtime/field.rb', line 375

def deserialize(value)
  Varint.decodeZigZag32(value)
end

#serialize(value) ⇒ Object



371
372
373
# File 'lib/protocol_buffers/runtime/field.rb', line 371

def serialize(value)
  Varint.encodeZigZag32(value)
end