Class: ProtocolBuffers::Field::DoubleField
- Inherits:
-
ProtocolBuffers::Field
- Object
- ProtocolBuffers::Field
- ProtocolBuffers::Field::DoubleField
- Includes:
- WireFormats::FIXED64
- Defined in:
- lib/protocol_buffers/runtime/field.rb
Instance Attribute Summary
Attributes inherited from ProtocolBuffers::Field
Instance Method Summary collapse
Methods included from WireFormats::FIXED64
#deserialize, #serialize, #wire_type
Methods inherited from ProtocolBuffers::Field
#add_methods_to, #check_valid, #check_value, create, #deserialize, #initialize, #inspect_value, #repeated?, #serialize
Constructor Details
This class inherits a constructor from ProtocolBuffers::Field
Instance Method Details
#default_value ⇒ Object
471 472 473 |
# File 'lib/protocol_buffers/runtime/field.rb', line 471 def default_value @opts[:default] || 0.0 end |
#pack_code ⇒ Object
463 464 465 |
# File 'lib/protocol_buffers/runtime/field.rb', line 463 def pack_code 'E' end |
#valid_type?(value) ⇒ Boolean
467 468 469 |
# File 'lib/protocol_buffers/runtime/field.rb', line 467 def valid_type?(value) value.is_a?(Numeric) end |