Sha256: ce5abf42f52b6cbcd4d56892afe0bf6b9cb78b1fc69395503139b4396f8e6564

Contents?: true

Size: 887 Bytes

Versions: 3

Compression:

Stored size: 887 Bytes

Contents

# frozen string_literal: true

require 'dry-struct'
require 'spy_alley_application/types/board_space'
require 'spy_alley_application/types/nationality'

module SpyAlleyApplication
  module Models
    module BoardSpaces
      class SoldTopSecretInformation < Dry::Struct
        @@can_handle_sold_top_secret_information =
          ::Types.Interface(:handle_sold_top_secret_information)
        attribute :id, ::Types::Coercible::Integer
        attribute :next_space, SpyAlleyApplication::Types::BoardSpace
        attribute :money_gained, ::Types::CoercibleNonnegativeInteger
        attribute :in_spy_alley, ::Types::Strict::Bool
        alias_method :in_spy_alley?, :in_spy_alley

        def accept(visitor, **args)
          @@can_handle_sold_top_secret_information.(visitor)
          visitor.handle_sold_top_secret_information(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/board_spaces/sold_top_secret_information.rb
spy_alley_application-0.3.1 lib/spy_alley_application/models/board_spaces/sold_top_secret_information.rb
spy_alley_application-0.3.0 lib/spy_alley_application/models/board_spaces/sold_top_secret_information.rb