Class: Aptible::Resource::Adapter

Inherits:
HyperResource::Adapter::HAL_JSON show all
Defined in:
lib/aptible/resource/adapter.rb

Class Method Summary collapse

Methods inherited from HyperResource::Adapter::HAL_JSON

apply, deserialize, serialize

Methods inherited from HyperResource::Adapter

apply, deserialize, serialize

Class Method Details

.get_data_type_from_object(object) ⇒ Object



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

def get_data_type_from_object(object)
  return nil unless object

  return nil unless (type = object['_type'])

  if type.respond_to?(:camelize)
    type.camelize
  else
    type[0].upcase + type[1..-1]
  end
end