Class: LanguageTool::Actions::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/languagetool/actions/check.rb

Constant Summary collapse

REQUIRED_PARAMETERS =
i(text language).freeze
OPTIONAL_PARAMETERS =
i(mother_tongue preferred_variants enabled_rules disabled_rules
enabled_categories disabled_categories enabled_only).freeze
PARAMETERS =
(REQUIRED_PARAMETERS + OPTIONAL_PARAMETERS).freeze

Instance Attribute Summary

Attributes inherited from Base

#api, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #safe_run

Constructor Details

This class inherits a constructor from LanguageTool::Actions::Base

Instance Method Details

#runObject



9
10
11
12
13
# File 'lib/languagetool/actions/check.rb', line 9

def run
  response = RestClient.get uri('check'), params: query
  $languagetool_last_response = response
  Resources::Matches.new JSON.parse(response.body).merge('original' => options[:text])
end