Module: Voltdb::VoltTableRowUtils
- Defined in:
- lib/voltdb/volt_table_row_utils.rb
Instance Method Summary collapse
-
#get_long_as_boolean(column_index_or_name) ⇒ Boolean
Get a long value from a VoltTableRow as a boolean value.
-
#get_long_or_nil(column_index_or_name) ⇒ VoltType, Boolean
Get the value of the column or nil.
-
#get_timestamp_as_ruby_date(column_index_or_name) ⇒ Date
Get a Ruby Date from a VoltTableRow timestamp type value.
-
#get_timestamp_as_ruby_date_time(column_index_or_name) ⇒ DateTime
Get a Ruby DateTime from a VoltTableRow timestamp type value.
-
#get_timestamp_as_ruby_time(column_index_or_name) ⇒ Time
Get a Ruby Time from a VoltTableRow timestamp type value.
Instance Method Details
#get_long_as_boolean(column_index_or_name) ⇒ Boolean
Get a long value from a VoltTableRow as a boolean value
8 9 10 |
# File 'lib/voltdb/volt_table_row_utils.rb', line 8 def get_long_as_boolean(column_index_or_name) self.get_long(column_index_or_name) == 1 end |
#get_long_or_nil(column_index_or_name) ⇒ VoltType, Boolean
Get the value of the column or nil
16 17 18 19 20 |
# File 'lib/voltdb/volt_table_row_utils.rb', line 16 def get_long_or_nil(column_index_or_name) value = self.get_long(column_index_or_name) self.was_null? ? nil : value end |
#get_timestamp_as_ruby_date(column_index_or_name) ⇒ Date
Get a Ruby Date from a VoltTableRow timestamp type value
36 37 38 39 40 |
# File 'lib/voltdb/volt_table_row_utils.rb', line 36 def (column_index_or_name) = (column_index_or_name) ? Date.parse(.to_s) : end |
#get_timestamp_as_ruby_date_time(column_index_or_name) ⇒ DateTime
Get a Ruby DateTime from a VoltTableRow timestamp type value
26 27 28 29 30 |
# File 'lib/voltdb/volt_table_row_utils.rb', line 26 def (column_index_or_name) = (column_index_or_name) ? DateTime.parse(.to_s) : end |
#get_timestamp_as_ruby_time(column_index_or_name) ⇒ Time
Get a Ruby Time from a VoltTableRow timestamp type value
46 47 48 49 50 |
# File 'lib/voltdb/volt_table_row_utils.rb', line 46 def (column_index_or_name) = (column_index_or_name) ? Time.parse(.to_s) : end |