Module: PG::TypeMap::DefaultTypeMappable
- Included in:
- PG::TypeMapByClass, PG::TypeMapByColumn, PG::TypeMapByMriType, PG::TypeMapByOid, PG::TypeMapInRuby
- Defined in:
- ext/pg_type_map.c
Instance Method Summary collapse
-
#default_type_map ⇒ TypeMap
Returns the default TypeMap that is currently set for values that could not be casted by this type map.
-
#default_type_map=(typemap) ⇒ Object
Set the default TypeMap that is used for values that could not be casted by this type map.
-
#with_default_type_map(typemap) ⇒ Object
Set the default TypeMap that is used for values that could not be casted by this type map.
Instance Method Details
#default_type_map ⇒ TypeMap
Returns the default TypeMap that is currently set for values that could not be casted by this type map.
Returns a kind of PG::TypeMap.
192 193 194 195 196 197 198 |
# File 'ext/pg_type_map.c', line 192
static VALUE
pg_typemap_default_type_map_get(VALUE self)
{
t_typemap *this = RTYPEDDATA_DATA( self );
return this->default_typemap;
}
|
#default_type_map=(typemap) ⇒ Object
Set the default TypeMap that is used for values that could not be casted by this type map.
typemap must be a kind of PG::TypeMap
167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'ext/pg_type_map.c', line 167
static VALUE
pg_typemap_default_type_map_set(VALUE self, VALUE typemap)
{
t_typemap *this = RTYPEDDATA_DATA( self );
t_typemap *tm;
UNUSED(tm);
rb_check_frozen(self);
/* Check type of method param */
TypedData_Get_Struct(typemap, t_typemap, &pg_typemap_type, tm);
RB_OBJ_WRITE(self, &this->default_typemap, typemap);
return typemap;
}
|
#with_default_type_map(typemap) ⇒ Object
Set the default TypeMap that is used for values that could not be casted by this type map.
typemap must be a kind of PG::TypeMap
Returns self.
211 212 213 214 215 216 |
# File 'ext/pg_type_map.c', line 211
static VALUE
pg_typemap_with_default_type_map(VALUE self, VALUE typemap)
{
pg_typemap_default_type_map_set( self, typemap );
return self;
}
|