Class: Integer
Instance Method Summary collapse
Instance Method Details
#to_msgpack ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/gri/mmsgpack.rb', line 4 def to_msgpack if (self >= -32 and self <= 127) [self].pack('c') elsif self < 4294967296 "\xd2"+[self].pack('N') else "\xcf"+[(self>>32), (self&0xffffffff)].pack('N2') end end |