Class: GraphqlDevise::MountMethod::OptionSanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_devise/mount_method/option_sanitizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, supported_options = MountMethod::SUPPORTED_OPTIONS) ⇒ OptionSanitizer

Returns a new instance of OptionSanitizer.



8
9
10
11
# File 'lib/graphql_devise/mount_method/option_sanitizer.rb', line 8

def initialize(options = {}, supported_options = MountMethod::SUPPORTED_OPTIONS)
  @options           = options
  @supported_options = supported_options
end

Instance Method Details

#call!Object



13
14
15
16
17
# File 'lib/graphql_devise/mount_method/option_sanitizer.rb', line 13

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