Module: Icasework::Resource::Data

Defined in:
lib/icasework/resource/data.rb

Overview

Converts data returned from the iCasework API into a more “Ruby like” hash

Class Method Summary collapse

Class Method Details

.process(data) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/icasework/resource/data.rb', line 10

def process(data)
  case data
  when Hash
    convert_keys(array_keys_to_array(flat_keys_to_nested(data)))
  when Array
    data.map { |d| process(d) }
  else
    data
  end
end