class Jylis::DataType::TLOG::Result
The result of a TLOG
query.
Public Class Methods
new(rows)
click to toggle source
# File lib/jylis-rb/data_types/tlog.rb, line 25 def initialize(rows) @rows = rows end
parse(query_result)
click to toggle source
Construct a Result
from a raw query result.
@param query_result [Array]
@return [Jylis::DataType::TLOG::Result]
# File lib/jylis-rb/data_types/tlog.rb, line 16 def self.parse(query_result) rows = query_result.reduce([]) do |memo, row| memo << Row.parse(row) memo end new(rows) end
Public Instance Methods
[](index)
click to toggle source
@return [Jylis::DataType::TLOG::Row] the row at the given index
# File lib/jylis-rb/data_types/tlog.rb, line 30 def [](index) @rows[index] end
count()
click to toggle source
@return [Integer] number of rows
# File lib/jylis-rb/data_types/tlog.rb, line 40 def count @rows.count end
each(&block)
click to toggle source
:no doc:
# File lib/jylis-rb/data_types/tlog.rb, line 35 def each(&block) @rows.each(&block) end
to_a()
click to toggle source
Reconstruct the raw result returned by the database.
# File lib/jylis-rb/data_types/tlog.rb, line 45 def to_a @rows.map(&:to_a) end