Class: PG::TypeMap

Inherits:
Object
  • Object
show all
Defined in:
ext/pg_type_map.c,
ext/pg_type_map.c

Overview

This is the base class for type maps. See derived classes for implementations of different type cast strategies ( PG::TypeMapByColumn, PG::TypeMapByOid ).

Instance Method Summary collapse

Instance Method Details

#fit_to_queryObject



85
86
87
88
89
90
91
92
93
# File 'ext/pg_type_map.c', line 85

static VALUE
pg_typemap_fit_to_query_ext( VALUE self, VALUE params )
{
	t_typemap *this = DATA_PTR( self );

	Check_Type( params, T_ARRAY);

	return this->fit_to_query( self, params );
}

#fit_to_resultObject



72
73
74
75
76
77
78
79
80
81
82
83
# File 'ext/pg_type_map.c', line 72

static VALUE
pg_typemap_fit_to_result_ext( VALUE self, VALUE result )
{
	t_typemap *this = DATA_PTR( self );

	if ( !rb_obj_is_kind_of(result, rb_cPGresult) ) {
		rb_raise( rb_eTypeError, "wrong argument type %s (expected kind of PG::Result)",
				rb_obj_classname( result ) );
	}

	return this->fit_to_result( self, result );
}