Class: IBM_DB::RowObject
- Inherits:
-
Object
- Object
- IBM_DB::RowObject
- Defined in:
- ext/ibm_db.c
Instance Method Summary collapse
-
#method_missing(*args) ⇒ Object
allow direct access to hash object as object attributes.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
allow direct access to hash object as object attributes
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 |
# File 'ext/ibm_db.c', line 642
VALUE ibm_db_row_object(int argc, VALUE *argv, VALUE self)
{
row_hash_struct *row_res;
VALUE symbol;
VALUE rest;
VALUE index;
Data_Get_Struct(self, row_hash_struct, row_res );
rb_scan_args(argc, argv, "1*", &symbol, &rest );
if ( symbol == ID2SYM(id_keys) ) {
return rb_funcall( row_res->hash, id_keys, 0 );
} else {
index = rb_funcall( symbol, id_id2name, 0 );
return rb_hash_aref( row_res->hash, index );
}
}
|