Sha256: f2b1788c6766fbaa8495085367d30ef1b03e89c2436c88ec69abf34403229417

Contents?: true

Size: 887 Bytes

Versions: 3

Compression:

Stored size: 887 Bytes

Contents

# frozen string literal: true

require 'dry-struct'
require 'game_validator/validator/validate_to_action'
require 'spy_alley_application/types/nationality'
require 'spy_alley_application/validator/make_accusation'

module SpyAlleyApplication
  module Models
    module Validator
      class MakingAccusation < Dry::Struct
        attribute :name, ::Types.Value('make_accusation')
        attribute :player_id_list, ::Types::ArrayOfStrictInteger
        attribute :wrap_result, ::Types::Callable

        def build(options={})
          @validate_to_action ||= GameValidator::Validator::ValidateToAction::new(
            validate: validate,
            wrap: wrap_result)
          @validate_to_action
        end

        private
        def validate
          SpyAlleyApplication::Validator::MakeAccusation::new(player_id_list: player_id_list)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spy_alley_application-0.3.2 lib/spy_alley_application/models/validator/making_accusation.rb
spy_alley_application-0.3.1 lib/spy_alley_application/models/validator/making_accusation.rb
spy_alley_application-0.3.0 lib/spy_alley_application/models/validator/making_accusation.rb