Class: Delivered::AnyType

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

Instance Method Summary collapse

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

#inspectObject



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

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