Class: Bug::Symbol

Inherits:
Symbol show all
Defined in:
ext/-test-/symbol/init.c

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Symbol

#as_json, json_create, #to_json

Class Method Details

.attrsetObject

.dynamic?(sym) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
53
54
# File 'ext/-test-/symbol/type.c', line 50

static VALUE
bug_dynamic_p(VALUE self, VALUE sym)
{
    return DYNAMIC_SYM_P(sym) ? Qtrue : Qfalse;
}

.find(sym) ⇒ Object



5
6
7
8
9
# File 'ext/-test-/symbol/init.c', line 5

static VALUE
sym_find(VALUE dummy, VALUE sym)
{
    return rb_check_symbol(&sym);
}

.id2str(sym) ⇒ Object



38
39
40
41
42
# File 'ext/-test-/symbol/type.c', line 38

static VALUE
bug_id2str(VALUE self, VALUE sym)
{
    return rb_sym2str(sym);
}

.iv_get(obj, name) ⇒ Object



23
24
25
26
27
28
# File 'ext/-test-/symbol/init.c', line 23

static VALUE
sym_iv_get(VALUE dummy, VALUE obj, VALUE name)
{
    const char *n = StringValueCStr(name);
    return rb_iv_get(obj, n);
}

.pindown(sym) ⇒ Object



59
60
61
62
63
64
# File 'ext/-test-/symbol/type.c', line 59

static VALUE
bug_pindown(VALUE self, VALUE sym)
{
    rb_pin_dynamic_symbol(sym);
    return sym;
}

.pinneddown?(sym) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
21
# File 'ext/-test-/symbol/init.c', line 11

static VALUE
sym_pinneddown_p(VALUE dummy, VALUE sym)
{
    ID id = rb_check_id(&sym);
    if (!id) return Qnil;
#ifdef ULL2NUM
    return ULL2NUM(id);
#else
    return ULONG2NUM(id);
#endif
}

.static?(sym) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
47
48
# File 'ext/-test-/symbol/type.c', line 44

static VALUE
bug_static_p(VALUE self, VALUE sym)
{
    return STATIC_SYM_P(sym) ? Qtrue : Qfalse;
}

Instance Method Details

#append(src, dst) ⇒ Object



4
5
6
7
8
9
# File 'ext/-test-/econv/append.c', line 4

static VALUE
econv_append(VALUE self, VALUE src, VALUE dst)
{
    rb_econv_t *ec = DATA_PTR(self);
    return rb_econv_str_append(ec, src, dst, 0);
}