Class: Groonga::Operator

Inherits:
Object
  • Object
show all
Defined in:
ext/groonga/rb-grn-operator.c

Constant Summary

PUSH =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("push"),
UINT2NUM(GRN_OP_PUSH))
POP =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("pop"),
UINT2NUM(GRN_OP_POP))
NO_OPERATION =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("no-operation"),
UINT2NUM(GRN_OP_NOP))
CALL =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("call"),
UINT2NUM(GRN_OP_CALL))
INTERN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("intern"),
UINT2NUM(GRN_OP_INTERN))
GET_REFERENCE =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("get-reference"),
UINT2NUM(GRN_OP_GET_REF))
GET_VALUE =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("get-value"),
UINT2NUM(GRN_OP_GET_VALUE))
AND =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("and"),
UINT2NUM(GRN_OP_AND))
AND_NOT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("and-not"),
UINT2NUM(GRN_OP_AND_NOT))
BUT =

REMOVE ME!

Just for backward compatiblity. TODO
OR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("or"),
UINT2NUM(GRN_OP_OR))
ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("assign"),
UINT2NUM(GRN_OP_ASSIGN))
STAR_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("star-assign"),
UINT2NUM(GRN_OP_STAR_ASSIGN))
SLASH_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("slash-assign"),
UINT2NUM(GRN_OP_SLASH_ASSIGN))
MODULO_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("modulo-assign"),
UINT2NUM(GRN_OP_MOD_ASSIGN))
PLUS_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("plus-assign"),
UINT2NUM(GRN_OP_PLUS_ASSIGN))
MINUS_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("minus-assign"),
UINT2NUM(GRN_OP_MINUS_ASSIGN))
SHIFTL_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shiftl-assign"),
UINT2NUM(GRN_OP_SHIFTL_ASSIGN))
SHIRTR_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shirtr-assign"),
UINT2NUM(GRN_OP_SHIFTR_ASSIGN))
SHIFTRR_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shiftrr-assign"),
UINT2NUM(GRN_OP_SHIFTRR_ASSIGN))
AND_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("and-assign"),
UINT2NUM(GRN_OP_AND_ASSIGN))
XOR_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("xor-assign"),
UINT2NUM(GRN_OP_XOR_ASSIGN))
OR_ASSIGN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("or-assign"),
UINT2NUM(GRN_OP_OR_ASSIGN))
JUMP =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("jump"),
UINT2NUM(GRN_OP_JUMP))
CJUMP =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("cjump"),
UINT2NUM(GRN_OP_CJUMP))
COMMA =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("comma"),
UINT2NUM(GRN_OP_COMMA))
BITWISE_OR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("bitwise-or"),
UINT2NUM(GRN_OP_BITWISE_OR))
BITWISE_XOR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("bitwise-xor"),
UINT2NUM(GRN_OP_BITWISE_XOR))
BITWISE_AND =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("bitwise-and"),
UINT2NUM(GRN_OP_BITWISE_AND))
BITWISE_NOT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("bitwise-not"),
UINT2NUM(GRN_OP_BITWISE_NOT))
EQUAL =
rb_funcall(rb_cGrnEqualOperator, rb_intern("new"), 2,
rb_str_new_cstr("equal"),
UINT2NUM(GRN_OP_EQUAL))
NOT_EQUAL =
rb_funcall(rb_cGrnNotEqualOperator, rb_intern("new"), 2,
rb_str_new_cstr("not-equal"),
UINT2NUM(GRN_OP_NOT_EQUAL))
LESS =
rb_funcall(rb_cGrnLessOperator, rb_intern("new"), 2,
rb_str_new_cstr("less"),
UINT2NUM(GRN_OP_LESS))
GREATER =
rb_funcall(rb_cGrnGreaterOperator, rb_intern("new"), 2,
rb_str_new_cstr("greater"),
UINT2NUM(GRN_OP_GREATER))
LESS_EQUAL =
rb_funcall(rb_cGrnLessEqualOperator, rb_intern("new"), 2,
rb_str_new_cstr("less-equal"),
UINT2NUM(GRN_OP_LESS_EQUAL))
GREATER_EQUAL =
rb_funcall(rb_cGrnGreaterEqualOperator, rb_intern("new"), 2,
rb_str_new_cstr("greater-equal"),
UINT2NUM(GRN_OP_GREATER_EQUAL))
IN =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("in"),
UINT2NUM(GRN_OP_IN))
MATCH =
rb_funcall(rb_cGrnMatchOperator, rb_intern("new"), 2,
rb_str_new_cstr("match"),
UINT2NUM(GRN_OP_MATCH))
NEAR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("near"),
UINT2NUM(GRN_OP_NEAR))
NEAR2 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("near2"),
UINT2NUM(GRN_OP_NEAR2))
SIMILAR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("similar"),
UINT2NUM(GRN_OP_SIMILAR))
TERM_EXTRACT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("term-extract"),
UINT2NUM(GRN_OP_TERM_EXTRACT))
SHIFTL =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shiftl"),
UINT2NUM(GRN_OP_SHIFTL))
SHIFTR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shiftr"),
UINT2NUM(GRN_OP_SHIFTR))
SHIFTRR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("shiftrr"),
UINT2NUM(GRN_OP_SHIFTRR))
PLUS =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("plus"),
UINT2NUM(GRN_OP_PLUS))
MINUS =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("minus"),
UINT2NUM(GRN_OP_MINUS))
STAR =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("star"),
UINT2NUM(GRN_OP_STAR))
SLASH =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("slash"),
UINT2NUM(GRN_OP_SLASH))
MODULO =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("modulo"),
UINT2NUM(GRN_OP_MOD))
DELETE =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("delete"),
UINT2NUM(GRN_OP_DELETE))
INCREMENT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("increment"),
UINT2NUM(GRN_OP_INCR))
DECREMENT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("decrement"),
UINT2NUM(GRN_OP_DECR))
INCREMENT_POST =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("increment-post"),
UINT2NUM(GRN_OP_INCR_POST))
DECREMENT_POST =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("decrement-post"),
UINT2NUM(GRN_OP_DECR_POST))
NOT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("not"),
UINT2NUM(GRN_OP_NOT))
ADJUST =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("adjust"),
UINT2NUM(GRN_OP_ADJUST))
EXACT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("exact"),
UINT2NUM(GRN_OP_EXACT))
LONGEST_COMMON_PREFIX =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("longest-common-prefix"),
UINT2NUM(GRN_OP_LCP))
PARTIAL =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("partial"),
UINT2NUM(GRN_OP_PARTIAL))
UNSPLIT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("unsplit"),
UINT2NUM(GRN_OP_UNSPLIT))
PREFIX =
rb_funcall(rb_cGrnPrefixOperator, rb_intern("new"), 2,
rb_str_new_cstr("prefix"),
UINT2NUM(GRN_OP_PREFIX))
SUFFIX =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("suffix"),
UINT2NUM(GRN_OP_SUFFIX))
GEO_DISTANCE1 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-distance1"),
UINT2NUM(GRN_OP_GEO_DISTANCE1))
GEO_DISTANCE2 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-distance2"),
UINT2NUM(GRN_OP_GEO_DISTANCE2))
GEO_DISTANCE3 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-distance3"),
UINT2NUM(GRN_OP_GEO_DISTANCE3))
GEO_DISTANCE4 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-distance4"),
UINT2NUM(GRN_OP_GEO_DISTANCE4))
GEO_WITHINP5 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-withinp5"),
UINT2NUM(GRN_OP_GEO_WITHINP5))
GEO_WITHINP6 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-withinp6"),
UINT2NUM(GRN_OP_GEO_WITHINP6))
GEO_WITHINP8 =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("geo-withinp8"),
UINT2NUM(GRN_OP_GEO_WITHINP8))
OBJECT_SEARCH =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("object-search"),
UINT2NUM(GRN_OP_OBJ_SEARCH))
EXPRESSION_GET_VARIABLE =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("expression-get-variable"),
UINT2NUM(GRN_OP_EXPR_GET_VAR))
TABLE_CREATE =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("table-create"),
UINT2NUM(GRN_OP_TABLE_CREATE))
TABLE_SELECT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("table-select"),
UINT2NUM(GRN_OP_TABLE_SELECT))
TABLE_SORT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("table-sort"),
UINT2NUM(GRN_OP_TABLE_SORT))
TABLE_GROUP =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("table-group"),
UINT2NUM(GRN_OP_TABLE_GROUP))
JSON_PUT =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("json-put"),
UINT2NUM(GRN_OP_JSON_PUT))
REGEXP =
rb_funcall(rb_cGrnRegexpOperator, rb_intern("new"), 2,
rb_str_new_cstr("regexp"),
UINT2NUM(GRN_OP_REGEXP))
FUZZY =
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("fuzzy"),
UINT2NUM(GRN_OP_FUZZY))

Instance Method Summary collapse

Constructor Details

#initializeObject



276
277
278
279
280
281
282
283
# File 'ext/groonga/rb-grn-operator.c', line 276

static VALUE
rb_grn_operator_initialize (VALUE self, VALUE rb_name, VALUE rb_value)
{
    rb_iv_set(self, "@name", rb_name);
    rb_iv_set(self, "@value", rb_value);

    return Qnil;
}

Instance Method Details

#to_iObject Also known as: to_int



285
286
287
288
289
# File 'ext/groonga/rb-grn-operator.c', line 285

static VALUE
rb_grn_operator_to_i (VALUE self)
{
    return rb_iv_get(self, "@value");
}

#to_sObject



291
292
293
294
295
296
297
298
# File 'ext/groonga/rb-grn-operator.c', line 291

static VALUE
rb_grn_operator_to_s (VALUE self)
{
    grn_operator operator;

    operator = rb_grn_operator_from_ruby_object(self);
    return rb_str_new_cstr(grn_operator_to_string(operator));
}