HAYASHI Kentaro
null+****@clear*****
Thu Apr 2 18:57:10 JST 2015
HAYASHI Kentaro 2015-04-02 18:57:10 +0900 (Thu, 02 Apr 2015) New Revision: 03e87aaf6aa3d4f5d96063f911e2c79b653676ed https://github.com/ranguba/rroonga/commit/03e87aaf6aa3d4f5d96063f911e2c79b653676ed Message: Add utility function which converts to ruby's string Modified files: ext/groonga/rb-grn-utils.c ext/groonga/rb-grn.h Modified: ext/groonga/rb-grn-utils.c (+6 -0) =================================================================== --- ext/groonga/rb-grn-utils.c 2015-04-02 18:17:22 +0900 (d9eb5e4) +++ ext/groonga/rb-grn-utils.c 2015-04-02 18:57:10 +0900 (69a3da5) @@ -178,6 +178,12 @@ rb_grn_convert_to_array (VALUE object) } VALUE +rb_grn_convert_to_string (VALUE object) +{ + return rb_convert_type(object, RUBY_T_STRING, "String", "to_s"); +} + +VALUE rb_grn_check_convert_to_string (VALUE object) { return rb_check_string_type(object); Modified: ext/groonga/rb-grn.h (+1 -0) =================================================================== --- ext/groonga/rb-grn.h 2015-04-02 18:17:22 +0900 (6c065cf) +++ ext/groonga/rb-grn.h 2015-04-02 18:57:10 +0900 (ec6497b) @@ -360,6 +360,7 @@ grn_bool rb_grn_equal_option (VALUE option, grn_bool rb_grn_equal_string (const char *string1, const char *string2); VALUE rb_grn_convert_to_array (VALUE object); +VALUE rb_grn_convert_to_string (VALUE object); VALUE rb_grn_check_convert_to_string (VALUE object); VALUE rb_grn_check_convert_to_array (VALUE object); VALUE rb_grn_check_convert_to_hash (VALUE object); -------------- next part -------------- HTML����������������������������... 다운로드