# File lib/facter.rb, line 125 def method_missing(name, *args) question = false if name.to_s =~ /\?$/ question = true name = name.to_s.sub(/\?$/,'') end if fact = collection.fact(name) if question value = fact.value.downcase args.each do |arg| if arg.to_s.downcase == value return true end end # If we got this far, there was no match. return false else return fact.value end else # Else, fail like a normal missing method. raise NoMethodError, "Could not find fact '%s'" % name end end