Class: PGresult

Inherits:
Object
  • Object
show all
Defined in:
lib/og/adapter/postgresql/override.rb

Overview

:nodoc: all

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)

48
49
50
# File 'lib/og/adapter/postgresql/override.rb', line 48

def blank?
  0 == num_tuples
end

#each_rowObject


57
58
59
60
61
# File 'lib/og/adapter/postgresql/override.rb', line 57

def each_row
  result.each_with_index do |row, idx|
    yield(row, idx)
  end
end

#first_valueObject


63
64
65
66
67
# File 'lib/og/adapter/postgresql/override.rb', line 63

def first_value
  val = getvalue(0, 0)
  clear
  return val
end

#nextObject


52
53
54
55
# File 'lib/og/adapter/postgresql/override.rb', line 52

def next
  @row_idx ||= -1
  result[@row_idx += 1]
end