Class: DBI::DBD::OCI8::BindType::DBITimestamp
- Inherits:
-
OCI8::BindType::OraDate
- Object
- OCI8::BindType::OraDate
- DBI::DBD::OCI8::BindType::DBITimestamp
- Defined in:
- lib/dbd/OCI8.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.decorate(b) ⇒ Object
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 |
# File 'lib/dbd/OCI8.rb', line 546 def decorate(b) def b.set(val) # convert val to an OraDate, # then set it to the bind handle. super(val && OraDate.new(val.year, val.month, val.day, val.respond_to?(:hour) ? val.hour : 0, val.respond_to?(:min) ? val.min : 0, val.respond_to?(:sec) ? val.sec : 0)) end def b.get() # get an Oradate from the bind handle, # then convert it to a DBI::Timestamp. (val = super()) && DBI::Timestamp.new(val.year, val.month, val.day, val.hour, val.minute, val.second) end end |
Instance Method Details
#get ⇒ Object
457 458 459 460 461 462 463 |
# File 'lib/dbd/OCI8.rb', line 457 def get() # get an Oradate from the bind handle, # then convert it to a DBI::Timestamp. val = super() return nil if val.nil? DBI::Timestamp.new(val.year, val.month, val.day, val.hour, val.minute, val.second) end |
#set(val) ⇒ Object
449 450 451 452 453 454 455 456 |
# File 'lib/dbd/OCI8.rb', line 449 def set(val) # convert val to an OraDate, # then set it to the bind handle. super(val && OraDate.new(val.year, val.month, val.day, val.respond_to?(:hour) ? val.hour : 0, val.respond_to?(:min) ? val.min : 0, val.respond_to?(:sec) ? val.sec : 0)) end |