Class: LanguageTool::Resources::Rule

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Rule

Returns a new instance of Rule.



6
7
8
9
10
11
12
13
14
# File 'lib/languagetool/resources/rule.rb', line 6

def initialize(json)
  @id = json['id']
  @description = json['description']
  @issue_type = json['issueType']
  @offset = json['offset']
  @length = json['length']

  @category = RuleCategory.new json['category']
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



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

def category
  @category
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#issue_typeObject (readonly)

Returns the value of attribute issue_type.



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

def issue_type
  @issue_type
end