Class: Typespec::Or
- Inherits:
-
Object
- Object
- Typespec::Or
- Defined in:
- lib/typespec.rb
Overview
…
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*expects) ⇒ Or
constructor
A new instance of Or.
- #valid?(value) ⇒ Boolean
Constructor Details
#initialize(*expects) ⇒ Or
Returns a new instance of Or.
45 |
# File 'lib/typespec.rb', line 45 def initialize(*expects); @expects = [*expects]; end |
Class Method Details
.[](*expects) ⇒ Object
46 |
# File 'lib/typespec.rb', line 46 def self.[](*expects); self.new(*expects); end |
Instance Method Details
#valid?(value) ⇒ Boolean
47 |
# File 'lib/typespec.rb', line 47 def valid?(value); @expects.any?{|expects| expects.valid?(value)}; end |