Sha256: 1db6f666e3533c3cbec4fdb34efe52997ea69b4e0728b83843a450d46562e92e

Contents?: true

Size: 509 Bytes

Versions: 7

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

module GraphqlDevise
  module MountMethod
    class OptionSanitizer
      def initialize(options = {}, supported_options = MountMethod::SUPPORTED_OPTIONS)
        @options           = options
        @supported_options = supported_options
      end

      def call!
        @supported_options.each_with_object(Struct.new(*@supported_options.keys).new) do |(key, checker), result|
          result[key] = checker.call!(@options[key], key)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
graphql_devise-1.4.0 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.3.0 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.2.0 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.1.1 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.1.0 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.0.1 lib/graphql_devise/mount_method/option_sanitizer.rb
graphql_devise-1.0.0 lib/graphql_devise/mount_method/option_sanitizer.rb