Sha256: b994ce2df941496221438b25257590be596876460eb7d9e25bad86e6f2a9883f

Contents?: true

Size: 528 Bytes

Versions: 8

Compression:

Stored size: 528 Bytes

Contents

# rubocop:disable ClassAndModuleChildren
module Aptible
  class Api::Adapter < HyperResource::Adapter::HAL_JSON
    class << self
      # rubocop:disable MethodLength
      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
      # rubocop:enable MethodLength
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aptible-api-0.4.8 lib/aptible/api/adapter.rb
aptible-api-0.4.7 lib/aptible/api/adapter.rb
aptible-api-0.4.6 lib/aptible/api/adapter.rb
aptible-api-0.4.5 lib/aptible/api/adapter.rb
aptible-api-0.4.4 lib/aptible/api/adapter.rb
aptible-api-0.4.3 lib/aptible/api/adapter.rb
aptible-api-0.4.2 lib/aptible/api/adapter.rb
aptible-api-0.4.1 lib/aptible/api/adapter.rb