Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Defines Object#respond_to_missing? and patches Object#respond_to?

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 respond_to_missing.gemspec
README.rdoc

respond_to_missing

Defines Object#respond_to_missing? and patches Object#respond_to? unless this functionality has already been implemented (ruby versions 1.9+)

Installation

gem install respond_to_missing

Usage

Define respond_to_missing? whenever an object overrides method_missing

class User
  def method_missing(method_name, *args)
    method_name == :test_method ? true : super
  end

  def respond_to_missing?(method_name, include_super)
    method_name == :test_method || super
  end
end

Testing

rake
Something went wrong with that request. Please try again.