Class: TerraformEnterprise::CommandLine::Formatter
- Inherits:
-
Object
- Object
- TerraformEnterprise::CommandLine::Formatter
- Defined in:
- lib/terraform_enterprise/command_line/formatter.rb
Overview
Module with render method to render the Resource object
Instance Method Summary collapse
Instance Method Details
#error(message) ⇒ Object
28 29 30 |
# File 'lib/terraform_enterprise/command_line/formatter.rb', line 28 def error() puts "Error: #{}".red end |
#render(obj, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/terraform_enterprise/command_line/formatter.rb', line 11 def render(obj, = {}) if .include?(:color) String.disable_colorization = ![:color] end if !obj.is_a?(TerraformEnterprise::API::Response) unkown_response(obj) elsif obj.success? render_resource(obj, ) elsif obj.errors? render_errors(obj) else unkown_response(obj.body) end end |
#success(message) ⇒ Object
32 33 34 |
# File 'lib/terraform_enterprise/command_line/formatter.rb', line 32 def success() puts .green end |