Class: RubyHoldem::Round::MoveValidator
- Inherits:
-
Object
- Object
- RubyHoldem::Round::MoveValidator
- Defined in:
- lib/ruby_holdem/round/move_validator.rb
Instance Attribute Summary collapse
-
#move ⇒ Object
readonly
Returns the value of attribute move.
-
#round ⇒ Object
readonly
Returns the value of attribute round.
Instance Method Summary collapse
-
#initialize(round, move) ⇒ MoveValidator
constructor
A new instance of MoveValidator.
- #validate ⇒ Object
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
#move ⇒ Object (readonly)
Returns the value of attribute move.
4 5 6 |
# File 'lib/ruby_holdem/round/move_validator.rb', line 4 def move @move end |
#round ⇒ Object (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
#validate ⇒ Object
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 |