Class: Avmtrf1::Tools::Runner::Oracle::Query
- Inherits:
-
EacRubyUtils::Console::DocoptRunner
- Object
- EacRubyUtils::Console::DocoptRunner
- Avmtrf1::Tools::Runner::Oracle::Query
- Includes:
- EacCli::DefaultRunner
- Defined in:
- lib/avmtrf1/tools/runner/oracle/query.rb
Constant Summary collapse
- DEFAULT_COLUMN_SEPARATOR =
"\t"
- DEFAULT_ROW_SEPARATOR =
"\n"
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
26 27 28 |
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 26 def count @count end |
Instance Method Details
#print_body ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 40 def print_body @count = 0 cursor.fetch do |row| print_row(row) @count += 1 end end |
#print_footer ⇒ Object
48 49 50 51 52 |
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 48 def return unless .fetch('--count') print_row(["Count: #{count}"]) end |
#print_header ⇒ Object
34 35 36 37 38 |
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 34 def print_header return unless .fetch('--columns') print_row(cursor..map(&:name)) end |
#run ⇒ Object
28 29 30 31 32 |
# File 'lib/avmtrf1/tools/runner/oracle/query.rb', line 28 def run print_header print_body end |