Class: Protobuf::Field::DoubleField

Inherits:
FloatField show all
Defined in:
lib/protobuf/message/field.rb

Instance Attribute Summary

Attributes inherited from BaseField

#default, #default_value, #message_class, #name, #rule, #tag, #type

Instance Method Summary collapse

Methods inherited from FloatField

#acceptable?, default, max, min

Methods inherited from BaseField

#acceptable?, default, descriptor, #descriptor, #initialize, #initialized?, #max, #merge, #min, #optional?, #packed?, #ready?, #repeated?, #required?, #set, #to_s

Constructor Details

This class inherits a constructor from Protobuf::Field::BaseField

Instance Method Details

#decode(bytes) ⇒ Object



504
505
506
# File 'lib/protobuf/message/field.rb', line 504

def decode(bytes)
  bytes.unpack('E').first
end

#encode(value) ⇒ Object



508
509
510
# File 'lib/protobuf/message/field.rb', line 508

def encode(value)
  [value].pack('E')
end

#wire_typeObject



500
501
502
# File 'lib/protobuf/message/field.rb', line 500

def wire_type
  WireType::FIXED64
end