Method: Inspec::EachLoop#to_ruby

Defined in:
lib/inspec/objects/each_loop.rb

#to_rubyObject



26
27
28
29
30
# File 'lib/inspec/objects/each_loop.rb', line 26

def to_ruby
  obj = super
  all_tests = @tests.map(&:to_ruby).join("\n").gsub("\n", "\n  ")
  format("%s.each do |entry|\n  %s\nend", obj, all_tests)
end