Class: GraphqlDevise::MountMethod::OptionValidators::SkipOnlyValidator

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

Instance Method Summary collapse

Constructor Details

#initialize(options:) ⇒ SkipOnlyValidator

Returns a new instance of SkipOnlyValidator.



7
8
9
# File 'lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb', line 7

def initialize(options:)
  @options = options
end

Instance Method Details

#validate!Object



11
12
13
14
15
16
17
18
# File 'lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb', line 11

def validate!
  if [@options.skip, @options.only].all?(&:present?)
    raise(
      InvalidMountOptionsError,
      "Can't specify both `skip` and `only` options when mounting the route."
    )
  end
end