Sha256: 99aae3cada29d3fa00cacf7748ba982406768e7c1c284d7253126b602c11ed32

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

# frozen_string_literal: true

module JSONAPIHelpers
  module Params
    class Includes
      attr_reader :include_param

      def initialize(include_param)
        @include_param = StringSupport.underscore(include_param || '')
      end

      def permit(*permitted_includes)
        include_array = include_param.split(',')
        include_array & permitted_includes.flatten(1)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jsonapi_helpers-0.2.0 lib/jsonapi_helpers/params/includes.rb