HAYASHI Kentaro
null+****@clear*****
Fri Apr 3 14:44:41 JST 2015
HAYASHI Kentaro 2015-04-03 14:44:41 +0900 (Fri, 03 Apr 2015) New Revision: d9805b14bb0b78be01e0fc9ed6956bce4701217c https://github.com/ranguba/rroonga/commit/d9805b14bb0b78be01e0fc9ed6956bce4701217c Merged 74fdf75: Merge pull request #83 from ranguba/add-convert-to-string Message: Add utility function which converts to 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-03 10:51:54 +0900 (d9eb5e4) +++ ext/groonga/rb-grn-utils.c 2015-04-03 14:44:41 +0900 (adf21ba) @@ -172,6 +172,12 @@ rb_grn_equal_string (const char *string1, const char *string2) } VALUE +rb_grn_convert_to_string (VALUE object) +{ + return rb_convert_type(object, RUBY_T_STRING, "String", "to_str"); +} + +VALUE rb_grn_convert_to_array (VALUE object) { return rb_convert_type(object, RUBY_T_ARRAY, "Array", "to_ary"); Modified: ext/groonga/rb-grn.h (+1 -0) =================================================================== --- ext/groonga/rb-grn.h 2015-04-03 10:51:54 +0900 (6c065cf) +++ ext/groonga/rb-grn.h 2015-04-03 14:44:41 +0900 (dda3443) @@ -359,6 +359,7 @@ grn_bool rb_grn_equal_option (VALUE option, const char *key); grn_bool rb_grn_equal_string (const char *string1, const char *string2); +VALUE rb_grn_convert_to_string (VALUE object); VALUE rb_grn_convert_to_array (VALUE object); VALUE rb_grn_check_convert_to_string (VALUE object); VALUE rb_grn_check_convert_to_array (VALUE object); -------------- next part -------------- HTML����������������������������...Download