method
method_missing
v2.3.8 -
Show latest stable
- Class:
NilClass
method_missing(method, *args, &block)private
No documentation available.
# File activesupport/lib/active_support/whiny_nil.rb, line 45
def method_missing(method, *args, &block)
# Ruby 1.9.2: disallow explicit coercion via method_missing.
if method == :to_ary || method == :to_str
raise NoMethodError, "undefined method `#{method}' for nil:NilClass"
elsif klass = METHOD_CLASS_MAP[method]
raise_nil_warning_for klass, method, caller
else
super
end
end