Class: Shithead::AI::DealIn

Inherits:
Object
  • Object
show all
Defined in:
lib/shithead/ai/deal_in.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(player) ⇒ DealIn

Returns a new instance of DealIn.



6
7
8
# File 'lib/shithead/ai/deal_in.rb', line 6

def initialize(player)
  @player = player
end

Class Method Details

.call(player) ⇒ Object



2
3
4
# File 'lib/shithead/ai/deal_in.rb', line 2

def self.call(player)
  new(player).call
end

Instance Method Details

#callObject



10
11
12
13
14
# File 'lib/shithead/ai/deal_in.rb', line 10

def call
  return if player.hand.empty?

  3.times { place ordered.shift }
end