Sha256: 6f4bd8ce3aff8ca320221b41552b9655309c93463191f56f9d9a37c11918d74c
Contents?: true
Size: 563 Bytes
Versions: 3
Compression:
Stored size: 563 Bytes
Contents
# frozen string literal: true require 'dry-initializer' module SpyAlleyApplication module Validator class ConfiscateMaterials include Dry::Initializer.define -> do option :validate_target_player_id, type: ::Types::Callable option :full_validator_for, type: ::Types::Hash end def call(action_hash) result = validate_target_player_id.(action_hash) return result if result.failure? validate = full_validator_for[result[:target_player_id]] validate.(action_hash) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems