Class: YaSpeller::Spell

Inherits:
Object
  • Object
show all
Defined in:
lib/ya_speller/spell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ Spell

Returns a new instance of Spell.



6
7
8
9
10
11
12
13
14
15
# File 'lib/ya_speller/spell.rb', line 6

def initialize record

  @code = record['code']
  @pos  = record['pos']
  @row  = record['row']
  @col  = record['col']
  @len  = record['len']
  @word = record['word']
  @s    = record['s']
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def code
  @code
end

#colObject (readonly)

Returns the value of attribute col.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def col
  @col
end

#lenObject (readonly)

Returns the value of attribute len.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def len
  @len
end

#posObject (readonly)

Returns the value of attribute pos.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def pos
  @pos
end

#rowObject (readonly)

Returns the value of attribute row.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def row
  @row
end

#sObject (readonly)

Returns the value of attribute s.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def s
  @s
end

#wordObject (readonly)

Returns the value of attribute word.



4
5
6
# File 'lib/ya_speller/spell.rb', line 4

def word
  @word
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/ya_speller/spell.rb', line 17

def to_s
    "Ошибка в слове: #{@word} \nправильное написание: #{@s}"
end