Class: Aptible::Api::Adapter

Inherits:
HyperResource::Adapter::HAL_JSON
  • Object
show all
Defined in:
lib/aptible/api/adapter.rb

Class Method Summary collapse

Class Method Details

.get_data_type_from_object(object) ⇒ Object

rubocop:disable MethodLength



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/aptible/api/adapter.rb', line 5

def get_data_type_from_object(object)
  return nil unless object

  if (type = object['_type'])
    if type.respond_to?(:camelize)
      type.camelize
    else
      type[0].upcase + type[1..-1]
    end
  else
    'Resource'
  end
end