Class: Delivered::ArrayOfType

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

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ ArrayOfType

Returns a new instance of ArrayOfType.



35
36
37
# File 'lib/delivered/types.rb', line 35

def initialize(type)
  @type = type
end

Instance Method Details

#===(value) ⇒ Object



42
43
44
# File 'lib/delivered/types.rb', line 42

def ===(value)
  Array === value && value.all? { |item| @type === item }
end

#inspectObject



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

def inspect = "ArrayOf(#{@type.inspect})"