Method: Paramore::Validate.types

Defined in:
lib/paramore/validate.rb

.types(type) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/paramore/validate.rb', line 17

def types(type)
  case type
  when Hash
    hash_types(type)
  when Array
    type.flat_map { |subtype| types(subtype) }
  else
    [type]
  end
end