Class: Dry::Mutations::Schema

Inherits:
Validation::Schema
  • Object
show all
Defined in:
lib/dry/mutations/schema.rb

Constant Summary collapse

MESSAGES_FILE =
(::File.join __dir__, '..', '..', '..', 'config', 'messages.yml').freeze
CONFIGURATOR =
->(config) do
  config.messages_file = MESSAGES_FILE
  config.hash_type = :symbolized
  config.input_processor = :sanitizer if config.input_processor == :noop
  config.predicates = ::Dry::Mutations::Predicates
  this = is_a?(::Dry::Validation::Schema) ? self : singleton_class
  config.registry = ::Dry::Validation::PredicateRegistry[this, config.predicates]
end
@@discarded =
[]

Instance Method Summary collapse

Instance Method Details

#discardedObject



18
19
20
# File 'lib/dry/mutations/schema.rb', line 18

def discarded
  @@discarded
end

#discarded!(value) ⇒ Object



26
27
28
# File 'lib/dry/mutations/schema.rb', line 26

def discarded! value
  discarded << value
end

#discarded?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dry/mutations/schema.rb', line 22

def discarded?
  discarded.empty?
end