Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#to_msgpack(*args) ⇒ Object

call-seq:

fixnum.to_msgpack(out = '') -> String

Serializes the Fixnum into raw bytes.



113
114
115
116
117
118
119
120
121
122
# File 'ext/pack.c', line 113

static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
  ARG_BUFFER(out, argc, argv);
#ifdef JRUBY
  msgpack_pack_long(out, FIXNUM_P(self) ? FIX2LONG(self) : rb_num2ll(self));
#else
  msgpack_pack_long(out, FIX2LONG(self));
#endif
  return out;
}