Class: Contract::Check::Any

Inherits:
Base
  • Object
show all
Defined in:
lib/contract/integration.rb

Overview

Checks that at least one of the specified conditions match. Example:

signature :x, Contract::Check::Any[String, Symbol]

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Contract::Check::Base

Instance Method Details

#===(other) ⇒ Object



70
71
72
# File 'lib/contract/integration.rb', line 70

def ===(other)
  @args.any? { |arg| arg === other }
end