Exception: Kotoshu::ResourceNotSetupError
- Defined in:
- lib/kotoshu/core/exceptions.rb
Overview
Error raised by the hot path (Kotoshu.correct?, .suggest, .check, .check_file, .spellchecker_for) when a language hasn’t been set up via Kotoshu.setup / kotoshu setup. The hot path is cache-only and never downloads — explicit setup is required.
Instance Attribute Summary collapse
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
Instance Method Summary collapse
-
#initialize(language, resource_type = "spelling") ⇒ ResourceNotSetupError
constructor
A new instance of ResourceNotSetupError.
Constructor Details
#initialize(language, resource_type = "spelling") ⇒ ResourceNotSetupError
Returns a new instance of ResourceNotSetupError.
123 124 125 126 127 128 129 |
# File 'lib/kotoshu/core/exceptions.rb', line 123 def initialize(language, resource_type = "spelling") @language = language @resource_type = resource_type super("Language '#{language}' is not set up (missing #{resource_type}). " \ "Run `kotoshu setup #{language}` or " \ "`Kotoshu.setup(:#{language})` first.") end |
Instance Attribute Details
#language ⇒ Object (readonly)
Returns the value of attribute language.
131 132 133 |
# File 'lib/kotoshu/core/exceptions.rb', line 131 def language @language end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
131 132 133 |
# File 'lib/kotoshu/core/exceptions.rb', line 131 def resource_type @resource_type end |