Method: Vcloud::Core::Query#initialize

Defined in:
lib/vcloud/core/query.rb

#initialize(type = nil, options = {}, query_runner = Vcloud::Core::QueryRunner.new) ⇒ Vcloud::Core::Query

Initialize a new Vcloud::Core::Query object

Parameters:

  • type (String) (defaults to: nil)

    Restrict query results to this type (see QueryRunner#available_query_types)

  • options (Hash) (defaults to: {})

    key :output_type defines the output type and defaults to tsv; csv and yaml are valid options

  • query_runner (Method) (defaults to: Vcloud::Core::QueryRunner.new)

    default=Vcloud::Core::QueryRunner.new



13
14
15
16
17
18
# File 'lib/vcloud/core/query.rb', line 13

def initialize(type=nil, options={}, query_runner = Vcloud::Core::QueryRunner.new)
  @type = type
  @options = options
  @options[:output_format] ||= 'tsv'
  @query_runner = query_runner
end