Class: WavefrontOutput::Yaml

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

Overview

Display as YAML

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #resp

Instance Method Summary collapse

Methods inherited from Base

#command_class, #command_class_name, #command_file, #filtered_response, #initialize, #items_only, #my_format, #run

Constructor Details

This class inherits a constructor from WavefrontOutput::Base

Instance Method Details

#_runObject

We don’t want the YAML keys to be symbols, so we load it as JSON and turn that into YAML.



13
14
15
# File 'lib/wavefront-cli/output/yaml.rb', line 13

def _run
  JSON.parse(resp.to_json).to_yaml
end

#allow_items_only?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/wavefront-cli/output/yaml.rb', line 17

def allow_items_only?
  true
end