Exception: Bug::Exception
- Defined in:
- ext/-test-/exception/init.c
Class Method Summary collapse
- .bignum?(self) ⇒ Boolean
- .capacity(str) ⇒ Object
- .class2name(klass) ⇒ Object
- .fixnum?(self) ⇒ Boolean
- .fstring(str) ⇒ Object
- .fstring_fake_str ⇒ Object
- .inspector ⇒ Object
- .missing_nextafter(vx, vy) ⇒ Object
- .positive_pow(x, y) ⇒ Object
- .rb_enc_interned_str(encoding) ⇒ Object
- .rb_enc_str_new(encoding) ⇒ Object
- .system_nextafter(vx, vy) ⇒ Object
- .to_bignum(x) ⇒ Object
Instance Method Summary collapse
Class Method Details
.bignum?(self) ⇒ Boolean
3 4 5 6 7 |
# File 'ext/-test-/integer/core_ext.c', line 3
static VALUE
int_bignum_p(VALUE klass, VALUE self)
{
return RB_TYPE_P(self, T_BIGNUM) ? Qtrue : Qfalse;
}
|
.capacity(str) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'ext/-test-/string/capacity.c', line 4
static VALUE
bug_str_capacity(VALUE klass, VALUE str)
{
if (!STR_EMBED_P(str) && STR_SHARED_P(str)) {
return INT2FIX(0);
}
return LONG2FIX(rb_str_capacity(str));
}
|
.class2name(klass) ⇒ Object
3 4 5 6 7 8 |
# File 'ext/-test-/class/class2name.c', line 3
static VALUE
class2name(VALUE self, VALUE klass)
{
const char *name = rb_class2name(klass);
return name ? rb_str_new_cstr(name) : Qnil;
}
|
.fixnum?(self) ⇒ Boolean
9 10 11 12 13 |
# File 'ext/-test-/integer/core_ext.c', line 9
static VALUE
int_fixnum_p(VALUE klass, VALUE self)
{
return FIXNUM_P(self) ? Qtrue : Qfalse;
}
|
.fstring(str) ⇒ Object
7 8 9 10 11 |
# File 'ext/-test-/string/fstring.c', line 7
VALUE
bug_s_fstring(VALUE self, VALUE str)
{
return rb_fstring(str);
}
|
.fstring_fake_str ⇒ Object
13 14 15 16 17 18 19 |
# File 'ext/-test-/string/fstring.c', line 13
VALUE
bug_s_fstring_fake_str(VALUE self)
{
static const char literal[] = "abcdefghijklmnopqrstuvwxyz";
struct RString fake_str;
return rb_fstring(rb_setup_fake_str(&fake_str, literal, sizeof(literal) - 1, 0));
}
|
.inspector ⇒ Object
22 23 24 25 26 |
# File 'ext/-test-/debug/inspector.c', line 22
static VALUE
debug_inspector(VALUE self)
{
return rb_debug_inspector_open(callback, NULL);
}
|
.missing_nextafter(vx, vy) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'ext/-test-/float/nextafter.c', line 19
static VALUE
missing_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
{
double x, y, z;
x = NUM2DBL(vx);
y = NUM2DBL(vy);
z = missing_nextafter(x, y);
return DBL2NUM(z);
}
|
.positive_pow(x, y) ⇒ Object
23 24 25 26 27 |
# File 'ext/-test-/integer/core_ext.c', line 23
static VALUE
positive_pow(VALUE klass, VALUE x, VALUE y)
{
return rb_int_positive_pow(NUM2LONG(x), NUM2ULONG(y));
}
|
.rb_enc_interned_str(encoding) ⇒ Object
21 22 23 24 25 |
# File 'ext/-test-/string/fstring.c', line 21
VALUE
bug_s_rb_enc_interned_str(VALUE self, VALUE encoding)
{
return rb_enc_interned_str("foo", 3, RDATA(encoding)->data);
}
|
.rb_enc_str_new(encoding) ⇒ Object
27 28 29 30 31 |
# File 'ext/-test-/string/fstring.c', line 27
VALUE
bug_s_rb_enc_str_new(VALUE self, VALUE encoding)
{
return rb_enc_str_new("foo", 3, RDATA(encoding)->data);
}
|
.system_nextafter(vx, vy) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'ext/-test-/float/nextafter.c', line 3
static VALUE
system_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
{
double x, y, z;
x = NUM2DBL(vx);
y = NUM2DBL(vy);
z = nextafter(x, y);
return DBL2NUM(z);
}
|
.to_bignum(x) ⇒ Object
15 16 17 18 19 20 21 |
# File 'ext/-test-/integer/core_ext.c', line 15
static VALUE
rb_int_to_bignum(VALUE klass, VALUE x)
{
if (FIXNUM_P(x))
x = rb_int2big(FIX2LONG(x));
return x;
}
|
Instance Method Details
#append(addendum) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'ext/-test-/string/set_len.c', line 10
static VALUE
bug_str_append(VALUE str, VALUE addendum)
{
StringValue(addendum);
rb_str_modify_expand(str, RSTRING_LEN(addendum));
memcpy(RSTRING_END(str), RSTRING_PTR(addendum), RSTRING_LEN(addendum));
return str;
}
|
#set_len(len) ⇒ Object
3 4 5 6 7 8 |
# File 'ext/-test-/string/set_len.c', line 3
static VALUE
bug_str_set_len(VALUE str, VALUE len)
{
rb_str_set_len(str, NUM2LONG(len));
return str;
}
|