ruby: update rdoc

This commit is contained in:
frsyuki 2010-05-25 02:55:58 +09:00
parent d0af8aa9f1
commit dbebe9771b
3 changed files with 12 additions and 8 deletions

View File

@ -59,7 +59,6 @@ static ID s_append;
* nil.to_msgpack(out = '') -> String * nil.to_msgpack(out = '') -> String
* *
* Serializes the nil into raw bytes. * Serializes the nil into raw bytes.
* This calls to_msgpack reflectively for internal elements.
*/ */
static VALUE MessagePack_NilClass_to_msgpack(int argc, VALUE *argv, VALUE self) static VALUE MessagePack_NilClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{ {
@ -76,7 +75,6 @@ static VALUE MessagePack_NilClass_to_msgpack(int argc, VALUE *argv, VALUE self)
* true.to_msgpack(out = '') -> String * true.to_msgpack(out = '') -> String
* *
* Serializes the true into raw bytes. * Serializes the true into raw bytes.
* This calls to_msgpack reflectively for internal elements.
*/ */
static VALUE MessagePack_TrueClass_to_msgpack(int argc, VALUE *argv, VALUE self) static VALUE MessagePack_TrueClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{ {
@ -93,7 +91,6 @@ static VALUE MessagePack_TrueClass_to_msgpack(int argc, VALUE *argv, VALUE self)
* false.to_msgpack(out = '') -> String * false.to_msgpack(out = '') -> String
* *
* Serializes false into raw bytes. * Serializes false into raw bytes.
* This calls to_msgpack reflectively for internal elements.
*/ */
static VALUE MessagePack_FalseClass_to_msgpack(int argc, VALUE *argv, VALUE self) static VALUE MessagePack_FalseClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{ {
@ -110,7 +107,6 @@ static VALUE MessagePack_FalseClass_to_msgpack(int argc, VALUE *argv, VALUE self
* fixnum.to_msgpack(out = '') -> String * fixnum.to_msgpack(out = '') -> String
* *
* Serializes the Fixnum into raw bytes. * Serializes the Fixnum into raw bytes.
* This calls to_msgpack reflectively for internal elements.
*/ */
static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self) static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
{ {
@ -131,7 +127,6 @@ static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
* bignum.to_msgpack(out = '') -> String * bignum.to_msgpack(out = '') -> String
* *
* Serializes the Bignum into raw bytes. * Serializes the Bignum into raw bytes.
* This calls to_msgpack reflectively for internal elements.
*/ */
static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self) static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self)
{ {

View File

@ -27,10 +27,18 @@ static VALUE mMessagePack;
* It enables to exchange structured objects between many languages like JSON. * It enables to exchange structured objects between many languages like JSON.
* But unlike JSON, it is very fast and small. * But unlike JSON, it is very fast and small.
* *
* You can install MessagePack with rubygems.
*
* gem install msgpack
*
* Simple usage is as follows.
*
* require 'msgpack' * require 'msgpack'
* msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03" * msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
* MessagePack.unpack(msg) #=> [1,2,3] * MessagePack.unpack(msg) #=> [1,2,3]
* *
* Use Unpacker class for streaming deserialization.
*
*/ */
void Init_msgpack(void) void Init_msgpack(void)
{ {

View File

@ -654,7 +654,7 @@ void Init_msgpack_unpack(VALUE mMessagePack)
* Following code uses Buffered API with an input stream: * Following code uses Buffered API with an input stream:
* *
* # create an unpacker with input stream. * # create an unpacker with input stream.
* pac = MessagePack::Unpacker.new(stdin) * pac = MessagePack::Unpacker.new(STDIN)
* *
* # deserialize object one after another. * # deserialize object one after another.
* pac.each {|obj| * pac.each {|obj|
@ -663,8 +663,8 @@ void Init_msgpack_unpack(VALUE mMessagePack)
* *
* *
* Following code doesn't use the input stream and feeds buffer * Following code doesn't use the input stream and feeds buffer
* using *fill* method. This is useful to use special stream * manually. This is useful to use special stream or with
* or with event-driven I/O library. * event-driven I/O library.
* *
* # create an unpacker without input stream. * # create an unpacker without input stream.
* pac = MessagePack::Unpacker.new() * pac = MessagePack::Unpacker.new()
@ -677,6 +677,7 @@ void Init_msgpack_unpack(VALUE mMessagePack)
* # ... * # ...
* } * }
* *
*
* You can manage the buffer manually with the combination of * You can manage the buffer manually with the combination of
* *execute*, *finished?*, *data* and *reset* method. * *execute*, *finished?*, *data* and *reset* method.
* *