Navigation Menu

Skip to content

Commit

Permalink
Add utility function which converts to string
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Apr 3, 2015
1 parent 63488a9 commit d9805b1
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 @@ -171,6 +171,12 @@ rb_grn_equal_string (const char *string1, const char *string2)
return strcmp(string1, string2) == 0;
}

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

0 comments on commit d9805b1

Please sign in to comment.