Class: Delivered::RespondToType
- Inherits:
-
Object
- Object
- Delivered::RespondToType
- Defined in:
- lib/delivered/types.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(*methods) ⇒ RespondToType
constructor
A new instance of RespondToType.
- #inspect ⇒ Object
Constructor Details
#initialize(*methods) ⇒ RespondToType
68 69 70 |
# File 'lib/delivered/types.rb', line 68 def initialize(*methods) @methods = methods end |
Instance Method Details
#===(value) ⇒ Object
74 75 76 |
# File 'lib/delivered/types.rb', line 74 def ===(value) @methods.all? { |m| value.respond_to?(m) } end |
#inspect ⇒ Object
72 |
# File 'lib/delivered/types.rb', line 72 def inspect = "RespondTo(#{@methods.map(&:inspect).join(', ')})" |