Sha256: 8a952bef541893260e75e4f492ae273d2011eabaa872738998d2c373b8ce17d0

Contents?: true

Size: 508 Bytes

Versions: 9

Compression:

Stored size: 508 Bytes

Contents

module GraphqlDevise
  module MountMethod
    module OptionSanitizers
      class StringChecker
        def initialize(default_string = nil)
          @default_string = default_string
        end

        def call!(value, key)
          return @default_string if value.blank?

          unless value.instance_of?(String)
            raise GraphqlDevise::InvalidMountOptionsError, "`#{key}` option has an invalid value. String expected."
          end

          value
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql_devise-0.12.3 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.12.2 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.12.1 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.12.0 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.11.4 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.11.3 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.11.2 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.11.1 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
graphql_devise-0.11.0 lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb