Sha256: 0a2b4a0574ae628c305fc90fd84549c836b045cb92561453afea16160d7c0b88

Contents?: true

Size: 474 Bytes

Versions: 7

Compression:

Stored size: 474 Bytes

Contents

module ApiPack
  module Serializer
    module Adapter
      module FastJsonApi
        module_function

        def serializer_hash(resource, klass, opt: {})
          name_klass = klass.to_s.split('_').collect(&:capitalize).join

          serializer = "#{name_klass}Serializer"

          require "./app/serializers/fast_jsonapi/#{klass}_serializer"

          FastJsonapi.const_get(serializer).new(resource, opt).serializable_hash
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
api_pack-1.3.1 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.2.1 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.1.4 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.1.3 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.1.2 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.1.1 lib/api_pack/serializer/adapter/fast_json_api.rb
api_pack-1.0.1 lib/api_pack/serializer/adapter/fast_json_api.rb