Navigation Menu

Skip to content

Commit

Permalink
Add utility function which converts to ruby's string
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Apr 2, 2015
1 parent 5058dee commit 03e87aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/groonga/rb-grn-utils.c
Expand Up @@ -177,6 +177,12 @@ rb_grn_convert_to_array (VALUE object)
return rb_convert_type(object, RUBY_T_ARRAY, "Array", "to_ary");
}

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)
{
Expand Down
1 change: 1 addition & 0 deletions ext/groonga/rb-grn.h
Expand Up @@ -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);
Expand Down

0 comments on commit 03e87aa

Please sign in to comment.