Class: Protopuffs::Fixed32

Inherits:
Fixed32Base show all
Defined in:
lib/protopuffs/message/field.rb

Instance Attribute Summary

Attributes inherited from MessageField

#default, #identifier, #tag

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fixed32Base

shift, wire_type

Methods inherited from Numeric

#initialize

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



140
# File 'lib/protopuffs/message/field.rb', line 140

def self.encode(value); [value].pack('V') end

Instance Method Details

#decode(bytes) ⇒ Object



139
# File 'lib/protopuffs/message/field.rb', line 139

def decode(bytes);      bytes.unpack('V').first end