Class: ProtocolBuffers::Field::Sfixed32Field

Inherits:
NumericField show all
Includes:
WireFormats::FIXED32
Defined in:
lib/protocol_buffers/runtime/field.rb

Instance Attribute Summary

Attributes inherited from ProtocolBuffers::Field

#name, #otype, #tag

Instance Method Summary collapse

Methods included from WireFormats::FIXED32

#deserialize, #serialize, #wire_type

Methods inherited from NumericField

#check_value, #default_value

Methods inherited from ProtocolBuffers::Field

#add_methods_to, #add_reader_to, #add_writer_to, #check_valid, #check_value, create, #deserialize, #initialize, #inspect_value, #packed?, #repeated?, #serialize

Instance Method Details

#maxObject



457
458
459
# File 'lib/protocol_buffers/runtime/field.rb', line 457

def max
  (1 << 31) - 1
end

#minObject



453
454
455
# File 'lib/protocol_buffers/runtime/field.rb', line 453

def min
  -(1 << 31)
end

#pack_codeObject



449
450
451
# File 'lib/protocol_buffers/runtime/field.rb', line 449

def pack_code
  'l'
end

#valid_type?(value) ⇒ Boolean

Returns:

  • (Boolean)


461
462
463
# File 'lib/protocol_buffers/runtime/field.rb', line 461

def valid_type?(value)
  value.is_a?(Integer)
end