Module: FEEN::Parser
- Defined in:
- lib/feen/parser.rb,
lib/feen/parser/turn.rb,
lib/feen/parser/shape.rb,
lib/feen/parser/square.rb,
lib/feen/parser/in_hand.rb
Overview
The parser module.
Defined Under Namespace
Modules: InHand, Turn Classes: Shape, Square
Class Method Summary collapse
-
.call(feen) ⇒ Hash
Parse a FEEN string into position params.
Class Method Details
.call(feen) ⇒ Hash
Parse a FEEN string into position params.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/feen/parser.rb', line 30 def self.call(feen) square_str, side_id_str, in_hand_str = feen.split { in_hand: InHand.parse(in_hand_str), shape: Shape.new(square_str).to_a, side_id: Turn.parse(side_id_str), square: Square.new(square_str).to_h } end |