Class: RDStation::Error::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/rdstation/error/format.rb

Constant Summary collapse

FLAT_HASH =
'FLAT_HASH'
HASH_OF_ARRAYS =
'HASH_OF_ARRAYS'
ARRAY_OF_HASHES =
'ARRAY_OF_HASHES'
HASH_OF_MULTIPLE_TYPES =
'HASH_OF_MULTIPLE_TYPES'
HASH_OF_HASHES =
'HASH_OF_HASHES'
SINGLE_HASH =
'SINGLE_HASH'

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ Format

Returns a new instance of Format.



13
14
15
# File 'lib/rdstation/error/format.rb', line 13

def initialize(errors)
  @errors = errors
end

Instance Method Details

#formatObject



17
18
19
20
21
22
23
24
25
# File 'lib/rdstation/error/format.rb', line 17

def format
  return FLAT_HASH if flat_hash?
  return SINGLE_HASH if single_hash?
  return HASH_OF_ARRAYS if hash_of_arrays?
  return HASH_OF_HASHES if hash_of_hashes?
  return HASH_OF_MULTIPLE_TYPES if hash_of_multiple_types?

  ARRAY_OF_HASHES
end