Class: Delivered::AnyType
- Inherits:
-
Object
- Object
- Delivered::AnyType
- Defined in:
- lib/delivered/types.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(*types) ⇒ AnyType
constructor
A new instance of AnyType.
- #inspect ⇒ Object
Constructor Details
#initialize(*types) ⇒ AnyType
Returns a new instance of AnyType.
5 6 7 |
# File 'lib/delivered/types.rb', line 5 def initialize(*types) @types = types end |
Instance Method Details
#===(value) ⇒ Object
11 12 13 |
# File 'lib/delivered/types.rb', line 11 def ===(value) @types.empty? ? true : @types.any? { |type| type === value } end |
#inspect ⇒ Object
9 |
# File 'lib/delivered/types.rb', line 9 def inspect = "Any(#{@types.map(&:inspect).join(', ')})" |