Class: Crowbar::Client::Formatter::Base
- Inherits:
-
Object
- Object
- Crowbar::Client::Formatter::Base
- Defined in:
- lib/crowbar/client/formatter/base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #result ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
23 24 25 |
# File 'lib/crowbar/client/formatter/base.rb', line 23 def initialize( = {}) self. = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/crowbar/client/formatter/base.rb', line 21 def @options end |
Instance Method Details
#empty? ⇒ Boolean
41 42 43 |
# File 'lib/crowbar/client/formatter/base.rb', line 41 def empty? false end |
#result ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/crowbar/client/formatter/base.rb', line 27 def result case [: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 |