Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/wavefront-cli/output/hcl/dashboard.rb

Instance Method Summary collapse

Instance Method Details

#to_hcl_listString

Turn an array into a string which represents an HCL list

Returns:



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

Returns:



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