Sha256: c79619c1aae49d6bdc3e2a21038811b1c706d6b5cdaee0c87dbb21a1aef6e022

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

# frozen string literal: true

require 'dry-struct'
require 'spy_alley_application/types/coercible_integer_one_to_six'

module SpyAlleyApplication
  module Models
    module GameState
      class MoveOption < Dry::Struct
        @@can_handle_move_option = ::Types.Interface(:handle_move_option)

        attribute :name, ::Types::Value('move_option')
        attribute :seat, SpyAlleyApplication::Types::CoercibleIntegerOneToSix
        attribute :options, ::Types::Array::of(::Types::Coercible::Integer)
          .constrained(min_size: 2, max_size: 2)

        def accept(visitor, **args)
          @@can_handle_move_option.(visitor)
          visitor.handle_move_option(self, args)
        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/game_state/move_option.rb
spy_alley_application-0.3.1 lib/spy_alley_application/models/game_state/move_option.rb
spy_alley_application-0.3.0 lib/spy_alley_application/models/game_state/move_option.rb