Class: RubyHoldem::Round::MoveValidator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(round, move) ⇒ MoveValidator



6
7
8
9
# File 'lib/ruby_holdem/round/move_validator.rb', line 6

def initialize(round, move)
  @round = round
  @move = move
end

Instance Attribute Details

#moveObject (readonly)

Returns the value of attribute move.



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

def move
  @move
end

#roundObject (readonly)

Returns the value of attribute round.



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

def round
  @round
end

Instance Method Details

#validateObject



11
12
13
14
15
16
17
# File 'lib/ruby_holdem/round/move_validator.rb', line 11

def validate
  if blinds_turn? && blinds_not_met?
    raise MinRaiseNotMeet, "You must bet blinds."
  end

  send("validate_#{move_type}")
end