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
#message_class, #name, #options, #rule, #tag, #type_class
Instance Method Summary collapse
-
#decode(bytes) ⇒ Object
Public Instance Methods.
- #encode(value) ⇒ Object
- #wire_type ⇒ Object
Methods inherited from FloatField
#acceptable?, #coerce!, default
Methods inherited from BaseField
#acceptable?, #coerce!, default, #default, #default_value, #deprecated?, #enum?, #extension?, #getter, #initialize, #message?, #optional?, #packed?, #repeated?, #repeated_message?, #required?, #set, #setter, #to_s
Methods included from Logging
initialize_logger, #log_exception, #log_signature, #logger, #sign_message
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 |