Class: CsvQuery::Query
- Inherits:
-
Object
- Object
- CsvQuery::Query
- Defined in:
- lib/csv_query/query.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :delimiter => ',', :select => '*' }
Instance Attribute Summary collapse
-
#csv_data ⇒ Object
readonly
Returns the value of attribute csv_data.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(csv_data, outputter, options = {}) ⇒ Query
constructor
A new instance of Query.
- #run ⇒ Object
Constructor Details
#initialize(csv_data, outputter, options = {}) ⇒ Query
Returns a new instance of Query.
16 17 18 19 20 |
# File 'lib/csv_query/query.rb', line 16 def initialize(csv_data, outputter, = {}) @csv_data = csv_data @outputter = outputter @options = DEFAULT_OPTIONS.merge() end |
Instance Attribute Details
#csv_data ⇒ Object (readonly)
Returns the value of attribute csv_data.
9 10 11 |
# File 'lib/csv_query/query.rb', line 9 def csv_data @csv_data end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/csv_query/query.rb', line 9 def @options end |
Instance Method Details
#run ⇒ Object
22 23 24 25 |
# File 'lib/csv_query/query.rb', line 22 def run results = run_query output_results_table(results) end |