private Method

NilClass.raise_nil_warning_for(class_name = nil, selector = nil, with_caller = nil)

There's no documentation for this item.

Source Code

# File active_support/whiny_nil.rb, line 30
def raise_nil_warning_for(class_name = nil, selector = nil, with_caller = nil)
  message = "You have a nil object when you didn't expect it!"
  message << "\nYou might have expected an instance of #{class_name}." if class_name
  message << "\nThe error occurred while evaluating nil.#{selector}" if selector

  raise NoMethodError, message, with_caller || caller
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.