Module: Inspec::RubyHelper

Included in:
Describe, Test, Value
Defined in:
lib/inspec/objects/ruby_helper.rb

Instance Method Summary collapse

Instance Method Details

#ruby_qualifier(q) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/inspec/objects/ruby_helper.rb', line 3

def ruby_qualifier(q)
  if q.length <= 1
    q[0]
  elsif q[0] == "map" && q.length == 2
    q[0] + " " + q[1]
  else
    q[0] + "(" + q[1..-1].map(&:inspect).join(", ") + ")"
  end
end