class FilterTable::Trace

Public Class Methods

new() click to toggle source
# File lib/inspec/utils/filter.rb, line 56
def initialize
  @chain = []
end
to_ruby(trace) click to toggle source
# File lib/inspec/utils/filter.rb, line 74
def self.to_ruby(trace)
  chain = trace.instance_variable_get(:@chain)
  return "" if chain.empty?

  " " + chain.map do |el|
    m = el[0][0]
    args = el[0].drop(1)
    nxt = to_ruby(el[1])
    next m.to_s + nxt if args.empty?
    next m.to_s + " " + args[0].inspect + nxt if args.length == 1

    m.to_s + "(" + args.map(&:inspect).join(", ") + ")" + nxt
  end.join(" ")
end

Public Instance Methods

method_missing(*args) click to toggle source
# File lib/inspec/utils/filter.rb, line 68
def method_missing(*args)
  res = Trace.new
  @chain.push([args, res])
  res
end