Class: RubyHoldem::Round::MoveFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_holdem/round/move_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(round, player, move_type, amount) ⇒ MoveFactory

Returns a new instance of MoveFactory.



6
7
8
9
10
11
# File 'lib/ruby_holdem/round/move_factory.rb', line 6

def initialize(round, player, move_type, amount)
  @round = round
  @player = player
  @move_type = move_type
  @amount = amount
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/ruby_holdem/round/move_factory.rb', line 4

def amount
  @amount
end

#move_typeObject (readonly)

Returns the value of attribute move_type.



4
5
6
# File 'lib/ruby_holdem/round/move_factory.rb', line 4

def move_type
  @move_type
end

#playerObject (readonly)

Returns the value of attribute player.



4
5
6
# File 'lib/ruby_holdem/round/move_factory.rb', line 4

def player
  @player
end

#roundObject (readonly)

Returns the value of attribute round.



4
5
6
# File 'lib/ruby_holdem/round/move_factory.rb', line 4

def round
  @round
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
20
# File 'lib/ruby_holdem/round/move_factory.rb', line 13

def build
  {
    player: player,
    stage: stage,
    move_type: move_type,
    amount: actual_amount
  }
end