Module: Remap::State

Includes:
Dry::Core::Constants
Included in:
Base, Operation
Defined in:
lib/remap/state.rb,
lib/remap/state/types.rb,
lib/remap/state/schema.rb,
lib/remap/state/extension.rb

Defined Under Namespace

Modules: Extension, Types

Constant Summary collapse

Schema =
Dry::Schema.define do
  required(:input)

  required(:mapper).filled(Remap::Types::Mapper)
  required(:problems).hash
  required(:options).value(:hash)
  required(:path).array(Types::Key)

  optional(:index).filled(:integer)
  optional(:element).filled
  optional(:key).filled

  optional(:scope)
  optional(:value)
end

Instance Method Summary collapse

Instance Method Details

#state(value, mapper:, options: {}) ⇒ Object



18
19
20
# File 'lib/remap/state.rb', line 18

def state(value, mapper:, options: {})
  { value: value, input: value, mapper: mapper, problems: {}, path: [], options: options, values: value }._
end