Class: Avmtrf1::Tools::Runner::Oracle::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/avmtrf1/tools/runner/oracle/query.rb

Constant Summary collapse

DEFAULT_COLUMN_SEPARATOR =
"\t"
DEFAULT_ROW_SEPARATOR =
"\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



22
23
24
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 22

def count
  @count
end

Instance Method Details



36
37
38
39
40
41
42
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 36

def print_body
  @count = 0
  cursor.fetch do |row|
    print_row(row)
    @count += 1
  end
end


44
45
46
47
48
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 44

def print_footer
  return unless parsed.count?

  print_row(["Count: #{count}"])
end


30
31
32
33
34
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 30

def print_header
  return unless parsed.columns?

  print_row(cursor..map(&:name))
end

#runObject



24
25
26
27
28
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 24

def run
  print_header
  print_body
  print_footer
end