Class: WavefrontCsvOutput::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wavefront-cli/output/csv/base.rb

Overview

Standard output template

Direct Known Subclasses

Query, WavefrontWavefrontOutput::Query

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resp, options) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/wavefront-cli/output/csv/base.rb', line 10

def initialize(resp, options)
  @resp        = resp
  @options     = options
  post_initialize if respond_to?(:post_initialize)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/wavefront-cli/output/csv/base.rb', line 8

def options
  @options
end

#respObject (readonly)

Returns the value of attribute resp.



8
9
10
# File 'lib/wavefront-cli/output/csv/base.rb', line 8

def resp
  @resp
end

Instance Method Details

#check_query_responseObject



20
21
22
23
24
25
26
27
# File 'lib/wavefront-cli/output/csv/base.rb', line 20

def check_query_response
  return true unless resp[:timeseries].nil?

  puts 'No points match query.'
  exit 0
rescue StandardError
  raise WavefrontCli::Exception::UnparseableResponse
end

#runObject



16
17
18
# File 'lib/wavefront-cli/output/csv/base.rb', line 16

def run
  puts _run
end