Class: LanguageTool::Resources::Context
- Inherits:
-
Object
- Object
- LanguageTool::Resources::Context
- Defined in:
- lib/languagetool/resources/context.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(json) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(json) ⇒ Context
Returns a new instance of Context.
6 7 8 9 10 |
# File 'lib/languagetool/resources/context.rb', line 6 def initialize(json) @text = json['text'] @offset = json['offset'] @length = json['length'] end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
4 5 6 |
# File 'lib/languagetool/resources/context.rb', line 4 def length @length end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
4 5 6 |
# File 'lib/languagetool/resources/context.rb', line 4 def offset @offset end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/languagetool/resources/context.rb', line 4 def text @text end |