Class: ODPI::Dpi::IntervalYM

Inherits:
Object
  • Object
show all
Defined in:
ext/odpi_ext/rbdpi-struct.c

Instance Method Summary collapse

Constructor Details

#initialize(years, months) ⇒ Object


445
446
447
448
449
450
451
452
453
# File 'ext/odpi_ext/rbdpi-struct.c', line 445

static VALUE intvl_ym_initialize(VALUE self, VALUE years, VALUE months)
{
    dpiIntervalYM intvl;

    intvl.years = NUM2INT(years);
    intvl.months = NUM2INT(months);
    *TO_INTVL_YM(self) = intvl;
    return self;
}

Instance Method Details

#initialize_copy(other) ⇒ Object


455
456
457
458
459
# File 'ext/odpi_ext/rbdpi-struct.c', line 455

static VALUE intvl_ym_initialize_copy(VALUE self, VALUE other)
{
    *TO_INTVL_YM(self) = *TO_INTVL_YM(other);
    return self;
}

#inspectObject


461
462
463
464
465
466
467
468
# File 'ext/odpi_ext/rbdpi-struct.c', line 461

static VALUE intvl_ym_inspect(VALUE self)
{
    dpiIntervalYM *intvl = TO_INTVL_YM(self);

    return rb_sprintf("<%s: '%d-%d' year to month>",
                      rb_obj_classname(self),
                      intvl->years, intvl->months);
}

#monthsObject


485
486
487
488
489
490
# File 'ext/odpi_ext/rbdpi-struct.c', line 485

static VALUE intvl_ym_get_months(VALUE self)
{
    dpiIntervalYM *intvl = TO_INTVL_YM(self);

    return INT2NUM(intvl->months);
}

#months=(val) ⇒ Object


492
493
494
495
496
497
498
# File 'ext/odpi_ext/rbdpi-struct.c', line 492

static VALUE intvl_ym_set_months(VALUE self, VALUE val)
{
    dpiIntervalYM *intvl = TO_INTVL_YM(self);

    intvl->months = NUM2INT(val);
    return val;
}

#yearsObject


470
471
472
473
474
475
# File 'ext/odpi_ext/rbdpi-struct.c', line 470

static VALUE intvl_ym_get_years(VALUE self)
{
    dpiIntervalYM *intvl = TO_INTVL_YM(self);

    return INT2NUM(intvl->years);
}

#years=(val) ⇒ Object


477
478
479
480
481
482
483
# File 'ext/odpi_ext/rbdpi-struct.c', line 477

static VALUE intvl_ym_set_years(VALUE self, VALUE val)
{
    dpiIntervalYM *intvl = TO_INTVL_YM(self);

    intvl->years = NUM2INT(val);
    return val;
}