Defines Object#respond_to_missing? and patches Object#respond_to?
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
MIT-LICENSE
README.rdoc
Rakefile
respond_to_missing.gemspec

README.rdoc

respond_to_missing

Defines {Object#respond_to_missing?}[http://www.ruby-doc.org/core/classes/Object.html#M001006] and patches {Object#respond_to?}[http://www.ruby-doc.org/core/classes/Object.html#M001005] 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