Class: Vcloud::Core::Query
- Inherits:
-
Object
- Object
- Vcloud::Core::Query
- Defined in:
- lib/vcloud/core/query.rb
Instance Method Summary collapse
-
#get_all_results ⇒ Object
DEPRECATED: Please use
Vcloud::Core::QueryRunner.run
instead. -
#initialize(type = nil, options = {}, query_runner = Vcloud::Core::QueryRunner.new) ⇒ Vcloud::Core::Query
constructor
Initialize a new Vcloud::Core::Query object.
-
#run ⇒ void
Run the query and print to standard out.
Constructor Details
#initialize(type = nil, options = {}, query_runner = Vcloud::Core::QueryRunner.new) ⇒ Vcloud::Core::Query
Initialize a new Vcloud::Core::Query object
13 14 15 16 17 18 |
# File 'lib/vcloud/core/query.rb', line 13 def initialize(type=nil, ={}, query_runner = Vcloud::Core::QueryRunner.new) @type = type @options = @options[:output_format] ||= 'tsv' @query_runner = query_runner end |
Instance Method Details
#get_all_results ⇒ Object
DEPRECATED: Please use Vcloud::Core::QueryRunner.run
instead.
32 33 34 35 |
# File 'lib/vcloud/core/query.rb', line 32 def get_all_results warn "[DEPRECATION] `Vcloud::Core::Query::get_all_results` is deprecated. Please use `Vcloud::Core::QueryRunner.run` instead." @query_runner.run(@type, @options) end |
#run ⇒ void
This method returns an undefined value.
Run the query and print to standard out
23 24 25 26 27 28 29 |
# File 'lib/vcloud/core/query.rb', line 23 def run() if @type.nil? output_available_query_types else output_query_results end end |