Class: RightScaleCLI::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/rightscale_cli/output.rb

Class Method Summary collapse

Class Method Details

.render(content, root_element, options) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rightscale_cli/output.rb', line 19

def self.render(content, root_element, options)
 if options[:xml]
    require "active_support/core_ext"
    puts content.to_xml(:root => root_element)
  elsif options[:json]
    require 'json'
    puts JSON.pretty_generate(content)
  else
    require 'yaml'
    puts content.to_yaml
  end
end