Class: ProtocolBuffers::Field::Sfixed64Field

Inherits:
NumericField show all
Includes:
WireFormats::FIXED64
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::FIXED64

#deserialize, #serialize, #wire_type

Methods inherited from NumericField

#check_value, #default_value

Methods inherited from ProtocolBuffers::Field

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

Instance Method Details

#maxObject



435
436
437
# File 'lib/protocol_buffers/runtime/field.rb', line 435

def max
  (1 << 63) - 1
end

#minObject



431
432
433
# File 'lib/protocol_buffers/runtime/field.rb', line 431

def min
  -(1 << 63)
end

#pack_codeObject



427
428
429
# File 'lib/protocol_buffers/runtime/field.rb', line 427

def pack_code
  'q'
end

#valid_type?(value) ⇒ Boolean

Returns:

  • (Boolean)


439
440
441
# File 'lib/protocol_buffers/runtime/field.rb', line 439

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