Class: Protopuffs::SFixed32
- Inherits:
-
Fixed32Base
- Object
- MessageField
- Numeric
- Fixed32Base
- Protopuffs::SFixed32
- Defined in:
- lib/protopuffs/message/field.rb
Instance Attribute Summary
Attributes inherited from MessageField
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Fixed32Base
Methods inherited from Numeric
Methods inherited from MessageField
factory, #key, #optional?, #repeated?, shift_tag, #to_wire_format_with_value
Constructor Details
This class inherits a constructor from Protopuffs::Numeric
Class Method Details
.encode(value) ⇒ Object
148 |
# File 'lib/protopuffs/message/field.rb', line 148 def self.encode(value); [value].pack('V') end |
Instance Method Details
#decode(bytes) ⇒ Object
144 145 146 147 |
# File 'lib/protopuffs/message/field.rb', line 144 def decode(bytes) value = bytes.unpack('V').first value >= 2**31 ? value -= 2**32 : value end |