class Crowbar::Client::Formatter::Base

Base that provides methods shared between different formatters

Attributes

options[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/crowbar/client/formatter/base.rb, line 26
def initialize(options = {})
  self.options = options
end

Public Instance Methods

empty?() click to toggle source
# File lib/crowbar/client/formatter/base.rb, line 44
def empty?
  false
end
result() click to toggle source
# File lib/crowbar/client/formatter/base.rb, line 30
def result
  case options[:format].to_sym
  when :table
    process_table
  when :plain
    process_plain
  when :json
    process_json
  else
    raise InvalidFormatError,
      "You requested an invalid format for this resource"
  end
end