Class: LanguageTool::Resources::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/languagetool/resources/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lengthObject (readonly)

Returns the value of attribute length.



4
5
6
# File 'lib/languagetool/resources/context.rb', line 4

def length
  @length
end

#offsetObject (readonly)

Returns the value of attribute offset.



4
5
6
# File 'lib/languagetool/resources/context.rb', line 4

def offset
  @offset
end

#textObject (readonly)

Returns the value of attribute text.



4
5
6
# File 'lib/languagetool/resources/context.rb', line 4

def text
  @text
end