module Myasorubka::Unicode
This module provides downcase and upcase methods designed for Russian. The original code is written by Andrew Kozlov for the Petrovich library.
Constants
- RU_LOWERCASE
Russian small letters.
- RU_UPPERCASE
Russian capital letters.
Public Instance Methods
downcase(string)
click to toggle source
Returns a copy of the given string having replaced capital Russian letters with small ones.
@param string [String] a string. @return [String] a new string.
# File lib/myasorubka/unicode.rb, line 33 def downcase(string) string.tr(RU_UPPERCASE, RU_LOWERCASE).tap(&:downcase!) end
upcase(string)
click to toggle source
Returns a copy of the given string having replaced small Russian letters with capital ones.
@param string [String] a string. @return [String] a new string.
# File lib/myasorubka/unicode.rb, line 43 def upcase(string) string.tr(RU_LOWERCASE, RU_UPPERCASE).tap(&:upcase!) end