Sha256: 47a1e8c6bfe548f9df95e66adc6b7c4f3daaaa63e5bcf0b8a5bbae9dbcdd2858

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

# frozen string_literal: true

require 'dry-types'
require 'spy_alley_application/models/move_card'
require 'spy_alley_application/types/coercible_integer_one_to_six'

get_move_card = Hash.new{|h, k| h[k] = SpyAlleyApplication::Models::MoveCard::new(value: k)}

i = Class.new do
  def initialize(get_move_card)
    @get_move_card = get_move_card
  end

  def call(value)
    value = SpyAlleyApplication::Types::CoercibleIntegerOneToSix.call(value)
    @get_move_card[value]
  end
end.new(get_move_card)

SpyAlleyApplication::Types::MoveCard = ::Types::Constructor(Class){|value| i.call(value)}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spy_alley_application-0.3.2 lib/spy_alley_application/types/move_card.rb
spy_alley_application-0.3.1 lib/spy_alley_application/types/move_card.rb
spy_alley_application-0.3.0 lib/spy_alley_application/types/move_card.rb