Method: Bundler::Thor::CoreExt::HashWithIndifferentAccess#method_missing

Defined in:
lib/bundler/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


93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb', line 93

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