In Files

Parent

Mysql::Field

Constants

TYPE_TINY

TYPE

TYPE_ENUM
TYPE_DECIMAL
TYPE_SHORT
TYPE_LONG
TYPE_FLOAT
TYPE_DOUBLE
TYPE_NULL
TYPE_TIMESTAMP
TYPE_LONGLONG
TYPE_INT24
TYPE_DATE
TYPE_TIME
TYPE_DATETIME
TYPE_YEAR
TYPE_BIT
TYPE_NEWDECIMAL
TYPE_SET
TYPE_BLOB
TYPE_STRING
TYPE_VAR_STRING
TYPE_CHAR
NOT_NULL_FLAG

FLAG

PRI_KEY_FLAG
UNIQUE_KEY_FLAG
MULTIPLE_KEY_FLAG
BLOB_FLAG
UNSIGNED_FLAG
ZEROFILL_FLAG
BINARY_FLAG
ENUM_FLAG
AUTO_INCREMENT_FLAG
TIMESTAMP_FLAG
SET_FLAG
NUM_FLAG
PART_KEY_FLAG

Public Instance Methods

hash() click to toggle source

hash

static VALUE field_hash(VALUE obj)
{
    VALUE h = rb_hash_new();
    rb_hash_aset(h, rb_str_new2("name"), rb_iv_get(obj, "name"));
    rb_hash_aset(h, rb_str_new2("table"), rb_iv_get(obj, "table"));
    rb_hash_aset(h, rb_str_new2("def"), rb_iv_get(obj, "def"));
    rb_hash_aset(h, rb_str_new2("type"), rb_iv_get(obj, "type"));
    rb_hash_aset(h, rb_str_new2("length"), rb_iv_get(obj, "length"));
    rb_hash_aset(h, rb_str_new2("max_length"), rb_iv_get(obj, "max_length"));
    rb_hash_aset(h, rb_str_new2("flags"), rb_iv_get(obj, "flags"));
    rb_hash_aset(h, rb_str_new2("decimals"), rb_iv_get(obj, "decimals"));
    return h;
}
inspect() click to toggle source

inspect

static VALUE field_inspect(VALUE obj)
{
    VALUE n = rb_iv_get(obj, "name");
    VALUE s = rb_enc_str_new(0, RSTRING_LEN(n) + 16, DEFAULT_ENCODING);
    sprintf(RSTRING_PTR(s), "#<Mysql::Field:%s>", RSTRING_PTR(n));
    return s;
}
is_not_null?() click to toggle source

is_not_null?

static VALUE field_is_not_null(VALUE obj)
{
    return IS_NOT_NULL(NUM2INT(rb_iv_get(obj, "flags"))) ? Qtrue : Qfalse;
}
is_num?() click to toggle source

is_num?

static VALUE field_is_num(VALUE obj)
{
    return IS_NUM(NUM2INT(rb_iv_get(obj, "type"))) ? Qtrue : Qfalse;
}
is_pri_key?() click to toggle source

is_pri_key?

static VALUE field_is_pri_key(VALUE obj)
{
    return IS_PRI_KEY(NUM2INT(rb_iv_get(obj, "flags"))) ? Qtrue : Qfalse;
}

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.