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.



6
7
8
9
# File 'lib/graphql_devise/mount_method/option_sanitizer.rb', line 6

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

Instance Method Details

#call!Object



11
12
13
14
15
# File 'lib/graphql_devise/mount_method/option_sanitizer.rb', line 11

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