Class: Corrector::Cyrillic

Inherits:
String
  • Object
show all
Defined in:
app/services/corrector/cyrillic.rb

Overview

Converts string to uppercase and its latin letters to cyrillic ones.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Cyrillic

Converts letters in the source string to uppercase cyrillic ones.

Params:

value

The source string to be converted.

Returns a converted string.

Examples:

Cyrillic.new "mapka" # => "МАРКА"


25
26
27
28
# File 'app/services/corrector/cyrillic.rb', line 25

def initialize(value)
  @source = value
  super line
end

Instance Attribute Details

#sourceObject (readonly)

The source line for conversion.

Examples:

str = Cyrillic.new "mapc" # => "МАРС"
str.source # => "mapc"


14
15
16
# File 'app/services/corrector/cyrillic.rb', line 14

def source
  @source
end