Sha256: 546f314c9f2a3aba72a7707a6b148d51bfb8c7f62e83170feeb398b6dd462906

Contents?: true

Size: 712 Bytes

Versions: 3

Compression:

Stored size: 712 Bytes

Contents

# frozen string literal: true

require 'dry-struct'
require 'game_validator/validator/validate_to_action'
require 'spy_alley_application/validator/no_options'

module SpyAlleyApplication
  module Models
    module Validator
      class RollingDie < Dry::Struct
        attribute :name, ::Types.Value('roll_die')
        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::NoOptions
        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/rolling_die.rb
spy_alley_application-0.3.1 lib/spy_alley_application/models/validator/rolling_die.rb
spy_alley_application-0.3.0 lib/spy_alley_application/models/validator/rolling_die.rb