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.
9 |
# File 'lib/y_support/misc/respond_to.rb', line 9 def initialize method; @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
7 8 9 |
# File 'lib/y_support/misc/respond_to.rb', line 7 def method @method end |
Class Method Details
Instance Method Details
#===(obj) ⇒ Object
10 |
# File 'lib/y_support/misc/respond_to.rb', line 10 def === obj; obj.respond_to? method end |