Class: Delivered::RespondToType

Inherits:
Object
  • Object
show all
Defined in:
lib/delivered/types.rb

Instance Method Summary collapse

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

#inspectObject



72
# File 'lib/delivered/types.rb', line 72

def inspect = "RespondTo(#{@methods.map(&:inspect).join(', ')})"