class Sashite::Snn::Style
def with_letter(new_letter)
- Example: Change style letter -
Returns:
-
(Style)
- new immutable style instance with different letter
Parameters:
-
new_letter
(Symbol
) -- new letter (single ASCII letter as symbol)
def with_letter(new_letter) self.class.validate_letter(new_letter) return self if letter == new_letter # Ensure the new letter has the correct case for the current side adjusted_letter = first_player? ? new_letter.to_s.upcase.to_sym : new_letter.to_s.downcase.to_sym self.class.new(adjusted_letter, side) end