Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/wavefront-cli/output/hcl/stdlib/array.rb
Overview
Extensions to stdlib Array
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
9 10 11 |
# File 'lib/wavefront-cli/output/hcl/stdlib/array.rb', line 9 def to_hcl_list '[' + join(',') + ']' end |
#to_hcl_obj(indent = 0) ⇒ String
Turn an array into a string which represents an HCL object
16 17 18 19 20 21 |
# File 'lib/wavefront-cli/output/hcl/stdlib/array.rb', line 16 def to_hcl_obj(indent = 0) outpad = ' ' * indent inpad = ' ' * (indent + 2) "\n#{outpad}{\n#{inpad}" + join("\n#{inpad}") + "\n#{outpad}}" end |