Method: Foreman::Thor::CoreExt::HashWithIndifferentAccess#method_missing

Defined in:
lib/foreman/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb

#method_missing(method, *args) ⇒ Object (protected)

Magic predicates. For instance:

options.force?                  # => !!options['force']
options.shebang                 # => "/usr/lib/local/ruby"
options.test_framework?(:rspec) # => options[:test_framework] == :rspec


71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/foreman/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb', line 71

def method_missing(method, *args)
  method = method.to_s
  if method =~ /^(\w+)\?$/
    if args.empty?
      !!self[$1]
    else
      self[$1] == args.first
    end
  else
    self[method]
  end
end