Class: RespondTo
Overview
RespondTo class for easy use of respond_to? in case statements.
Constant Summary collapse
- Matchers =
{}
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Class Method Summary collapse
Instance Method Summary collapse
- #===(obj) ⇒ Object
-
#initialize(method) ⇒ RespondTo
constructor
A new instance of RespondTo.
Constructor Details
#initialize(method) ⇒ RespondTo
Returns a new instance of RespondTo.
11 |
# File 'lib/y_support/respond_to.rb', line 11 def initialize method; @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
9 10 11 |
# File 'lib/y_support/respond_to.rb', line 9 def method @method end |
Class Method Details
Instance Method Details
#===(obj) ⇒ Object
12 |
# File 'lib/y_support/respond_to.rb', line 12 def === obj; obj.respond_to? method end |