Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/wavefront-cli/output/hcl/dashboard.rb
Instance Method Summary collapse
-
#to_hcl_list ⇒ String
Turn an array into a string which represents an HCL list.
-
#to_hcl_obj(indent = 0) ⇒ String
Turn an array into a string which represents an HCL object.
Instance Method Details
#to_hcl_list ⇒ String
Turn an array into a string which represents an HCL list
101 102 103 |
# File 'lib/wavefront-cli/output/hcl/dashboard.rb', line 101 def to_hcl_list '[' + self.join(',') + ']' end |
#to_hcl_obj(indent = 0) ⇒ String
Turn an array into a string which represents an HCL object
108 109 110 111 112 113 |
# File 'lib/wavefront-cli/output/hcl/dashboard.rb', line 108 def to_hcl_obj(indent = 0) outpad = ' ' * indent inpad = ' ' * (indent + 2) "\n#{outpad}{\n#{inpad}" + self.join("\n#{inpad}") + "\n#{outpad}}" end |