Module: Sashite::Feen::Parser::StyleTurn
- Defined in:
- lib/sashite/feen/parser/style_turn.rb
Overview
Parser for the style-turn field (third field of FEEN).
Converts a FEEN style-turn string into a Styles object, decoding game style identifiers and the active player indicator.
Constant Summary collapse
- STYLE_SEPARATOR =
Style separator in style-turn field.
"/"
Class Method Summary collapse
-
.parse(string) ⇒ Styles
Parse a FEEN style-turn string into a Styles object.
Class Method Details
.parse(string) ⇒ Styles
Parse a FEEN style-turn string into a Styles object.
37 38 39 40 41 42 43 44 |
# File 'lib/sashite/feen/parser/style_turn.rb', line 37 def self.parse(string) active_str, inactive_str = split_styles(string) active = parse_style(active_str) inactive = parse_style(inactive_str) Styles.new(active, inactive) end |