Sha256: ebb594e4b12ff457179fe485bd5ae0ecc1f56cd054148766d4ce7af33e6e2c81

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

# frozen string_literal: true

require 'spy_alley_application/types/equipment'
require 'spy_alley_application/models/wild_card'

cached_wild_card = SpyAlleyApplication::Models::WildCard::new

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

  def call(free_gift)
    result = nil
    if free_gift.to_s.eql?('wild card')
      result = @cached_wild_card
    end
    result || SpyAlleyApplication::Types::Equipment.call(free_gift)
  end
end.new(cached_wild_card)

SpyAlleyApplication::Types::FreeGift = 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/free_gift.rb
spy_alley_application-0.3.1 lib/spy_alley_application/types/free_gift.rb
spy_alley_application-0.3.0 lib/spy_alley_application/types/free_gift.rb