Class: ODPI::Dpi::IntervalDS

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

Instance Method Summary collapse

Constructor Details

#initialize(days, hours, minutes, seconds, fseconds) ⇒ Object


320
321
322
323
324
325
326
327
328
329
330
331
# File 'ext/odpi_ext/rbdpi-struct.c', line 320

static VALUE intvl_ds_initialize(VALUE self, VALUE days, VALUE hours, VALUE minutes, VALUE seconds, VALUE fseconds)
{
    dpiIntervalDS intvl;

    intvl.days = NUM2INT(days);
    intvl.hours = NUM2INT(hours);
    intvl.minutes = NUM2INT(minutes);
    intvl.seconds = NUM2INT(seconds);
    intvl.fseconds = NUM2INT(fseconds);
    *TO_INTVL_DS(self) = intvl;
    return self;
}

Instance Method Details

#daysObject


349
350
351
352
353
354
# File 'ext/odpi_ext/rbdpi-struct.c', line 349

static VALUE intvl_ds_get_days(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return INT2NUM(intvl->days);
}

#days=(val) ⇒ Object


356
357
358
359
360
361
362
# File 'ext/odpi_ext/rbdpi-struct.c', line 356

static VALUE intvl_ds_set_days(VALUE self, VALUE val)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

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

#fsecondsObject


409
410
411
412
413
414
# File 'ext/odpi_ext/rbdpi-struct.c', line 409

static VALUE intvl_ds_get_fseconds(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return INT2NUM(intvl->fseconds);
}

#fseconds=(val) ⇒ Object


416
417
418
419
420
421
422
# File 'ext/odpi_ext/rbdpi-struct.c', line 416

static VALUE intvl_ds_set_fseconds(VALUE self, VALUE val)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

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

#hoursObject


364
365
366
367
368
369
# File 'ext/odpi_ext/rbdpi-struct.c', line 364

static VALUE intvl_ds_get_hours(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return INT2NUM(intvl->hours);
}

#hours=(val) ⇒ Object


371
372
373
374
375
376
377
# File 'ext/odpi_ext/rbdpi-struct.c', line 371

static VALUE intvl_ds_set_hours(VALUE self, VALUE val)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

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

#initialize_copy(other) ⇒ Object


333
334
335
336
337
# File 'ext/odpi_ext/rbdpi-struct.c', line 333

static VALUE intvl_ds_initialize_copy(VALUE self, VALUE other)
{
    *TO_INTVL_DS(self) = *TO_INTVL_DS(other);
    return self;
}

#inspectObject


339
340
341
342
343
344
345
346
347
# File 'ext/odpi_ext/rbdpi-struct.c', line 339

static VALUE intvl_ds_inspect(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return rb_sprintf("<%s: '%d %02d:%02d:%02d.%09d' day to second>",
                      rb_obj_classname(self),
                      intvl->days, intvl->hours, intvl->minutes,
                      intvl->seconds, intvl->fseconds);
}

#minutesObject


379
380
381
382
383
384
# File 'ext/odpi_ext/rbdpi-struct.c', line 379

static VALUE intvl_ds_get_minutes(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return INT2NUM(intvl->minutes);
}

#minutes=(val) ⇒ Object


386
387
388
389
390
391
392
# File 'ext/odpi_ext/rbdpi-struct.c', line 386

static VALUE intvl_ds_set_minutes(VALUE self, VALUE val)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

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

#secondsObject


394
395
396
397
398
399
# File 'ext/odpi_ext/rbdpi-struct.c', line 394

static VALUE intvl_ds_get_seconds(VALUE self)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

    return INT2NUM(intvl->seconds);
}

#seconds=(val) ⇒ Object


401
402
403
404
405
406
407
# File 'ext/odpi_ext/rbdpi-struct.c', line 401

static VALUE intvl_ds_set_seconds(VALUE self, VALUE val)
{
    dpiIntervalDS *intvl = TO_INTVL_DS(self);

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