module Shrug

Constants

VERSION
WHITELIST

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/shrug.rb, line 7
def method_missing(method, *args, &block)
  return if WHITELIST.include?(method.to_s)

  STDERR.puts("¯\\_(ツ)_/¯ (`#{method.to_s}' undefined)")

  safely default: self do
    raise NoMethodError.new("undefined method `#{method}' for nil:NilClass (¯\\_(ツ)_/¯)")
  end
end
respond_to_missing?(method, *args, &block) click to toggle source
# File lib/shrug.rb, line 17
def respond_to_missing?(method, *args, &block)
  !WHITELIST.include?(method.to_s)
end