Class: TXTextControl::ReportingCloud::IncorrectWord
- Inherits:
-
Object
- Object
- TXTextControl::ReportingCloud::IncorrectWord
- Defined in:
- lib/txtextcontrol/reportingcloud/incorrect_word.rb
Overview
Represents an incorrect word in spell checked text.
Instance Attribute Summary collapse
-
#is_duplicate ⇒ Boolean
(also: #is_duplicate?)
readonly
Indicating whether the spelled word is declared as incorrect, because the previous word has the same text.
-
#language ⇒ String
readonly
Indicating the language the incorrect word was spelled.
-
#length ⇒ Integer
readonly
The length of the spelled word.
-
#start ⇒ Integer
readonly
The starting position of a spelled word.
-
#text ⇒ String
readonly
The text of the spelled word.
Class Method Summary collapse
-
.from_camelized_hash(hash) ⇒ IncorrectWord
Creates an IncorrectWord instance from a hash.
Instance Method Summary collapse
-
#initialize(length, start, text, is_duplicate, language) ⇒ IncorrectWord
constructor
A new instance of IncorrectWord.
Constructor Details
#initialize(length, start, text, is_duplicate, language) ⇒ IncorrectWord
Returns a new instance of IncorrectWord
42 43 44 45 46 47 48 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 42 def initialize(length, start, text, is_duplicate, language) @length = Integer(length) @start = Integer(start) @text = text @is_duplicate = !!is_duplicate @language = language end |
Instance Attribute Details
#is_duplicate ⇒ Boolean (readonly) Also known as: is_duplicate?
Indicating whether the spelled word is declared as incorrect, because the previous word has the same text.
26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 26 def is_duplicate @is_duplicate end |
#language ⇒ String (readonly)
Indicating the language the incorrect word was spelled.
26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 26 def language @language end |
#length ⇒ Integer (readonly)
The length of the spelled word.
26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 26 def length @length end |
#start ⇒ Integer (readonly)
The starting position of a spelled word.
26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 26 def start @start end |
#text ⇒ String (readonly)
The text of the spelled word.
26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 26 def text @text end |
Class Method Details
.from_camelized_hash(hash) ⇒ IncorrectWord
Creates an IncorrectWord instance from a hash.
53 54 55 56 57 58 59 60 |
# File 'lib/txtextcontrol/reportingcloud/incorrect_word.rb', line 53 def self.from_camelized_hash(hash) l = hash["length"] s = hash["start"] txt = hash["text"] id = hash["isDuplicate"] lan = hash["language"] return IncorrectWord.new(l, s, txt, id, lan) end |