Method: Pry::Slop#method_missing

Defined in:
lib/pry/slop.rb

#method_missing(method, *args, &block) ⇒ Object (private)

Convenience method for present?(:option).

Examples:

opts.parse %( --verbose )
opts.verbose? #=> true
opts.other?   #=> false

Returns true if this option is present. If this method does not end with a ? character it will instead call super().



454
455
456
457
458
459
460
461
462
# File 'lib/pry/slop.rb', line 454

def method_missing(method, *args, &block)
  meth = method.to_s
  if meth.end_with?('?')
    meth = meth.chop
    present?(meth) || present?(meth.tr('_', '-'))
  else
    super
  end
end