Class: Protobuf::Field::DoubleField

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

Instance Attribute Summary

Attributes inherited from BaseField

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

Instance Method Summary collapse

Methods inherited from FloatField

#acceptable?, default, max, min

Methods inherited from BaseField

#acceptable?, #clear, default, #default_value, descriptor, #descriptor, #error_message, #get, #initialize, #initialized?, #max, #merge, #merge_array, #merge_value, #min, #optional?, #ready?, #repeated?, #required?, #set, #to_s, #typed_default_value

Constructor Details

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

Instance Method Details

#decode(bytes) ⇒ Object



455
456
457
# File 'lib/protobuf/message/field.rb', line 455

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

#encode(value) ⇒ Object



459
460
461
# File 'lib/protobuf/message/field.rb', line 459

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

#wire_typeObject



451
452
453
# File 'lib/protobuf/message/field.rb', line 451

def wire_type
  Protobuf::WireType::FIXED64
end