Class: Protobuf::Field::DoubleField
- Inherits:
-
FloatField
- Object
- BaseField
- FloatField
- Protobuf::Field::DoubleField
- Defined in:
- lib/protobuf/field/double_field.rb
Constant Summary
Constants inherited from BaseField
Instance Attribute Summary
Attributes inherited from BaseField
#default, #default_value, #deprecated, #extension, #getter_method_name, #message_class, #name, #optional, #packed, #repeated, #required, #rule, #setter_method_name, #tag, #type_class
Instance Method Summary collapse
-
#decode(bytes) ⇒ Object
Public Instance Methods.
- #encode(value) ⇒ Object
- #wire_type ⇒ Object
Methods inherited from FloatField
Methods inherited from BaseField
#acceptable?, default, #deprecated?, #enum?, #extension?, #initialize, #message?, #optional?, #packed?, #repeated?, #repeated_message?, #required?, #set, #to_s, #type, #warn_if_deprecated
Constructor Details
This class inherits a constructor from Protobuf::Field::BaseField
Instance Method Details
#decode(bytes) ⇒ Object
Public Instance Methods
11 12 13 |
# File 'lib/protobuf/field/double_field.rb', line 11 def decode(bytes) bytes.unpack('E').first end |
#encode(value) ⇒ Object
15 16 17 |
# File 'lib/protobuf/field/double_field.rb', line 15 def encode(value) [value].pack('E') end |