Some predicate methods for checking method visibility.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
visibility_predicates.gemspec

README.md

visibility_predicates

Build Status Gem Version

Some predicate methods for checking method visibility.

Features

  • Kernel#public_method?
  • Kernel#protected_method?
  • Kernel#private_method?
  • Module#public_instance_method?
  • Module#protected_instance_method?
  • Module#private_instance_method?

Usage

Overview

require 'visibility_predicates'

class Foo
  private; def modified_foobar; end
end

class Bar < Foo
  protected :modified_foobar
end

Bar.new.public_method? :modified_foobar    #=> false
Bar.new.protected_method? :modified_foobar #=> true
Bar.new.private_method? :modified_foobar   #=> false

Requirements

Install

gem install visibility_predicates

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.