Exception: Clickwrap::MissingTranslation
- Inherits:
-
DefinitionError
- Object
- StandardError
- Error
- DefinitionError
- Clickwrap::MissingTranslation
- Defined in:
- lib/clickwrap/localized_text.rb
Overview
Raised when a required human-facing string has no text for the requested locale. Clickwrap will not present a legal statement in a language the policy did not declare, and will not record one it could not render.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Instance Method Summary collapse
-
#initialize(key:, locale:) ⇒ MissingTranslation
constructor
A new instance of MissingTranslation.
Constructor Details
#initialize(key:, locale:) ⇒ MissingTranslation
Returns a new instance of MissingTranslation.
92 93 94 95 96 97 98 99 |
# File 'lib/clickwrap/localized_text.rb', line 92 def initialize(key:, locale:) @key = key @locale = locale super( "No text for #{key.inspect} in locale #{locale.inspect}. Add the translation, or " \ "restrict the policy to the locales it can actually present." ) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
90 91 92 |
# File 'lib/clickwrap/localized_text.rb', line 90 def key @key end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
90 91 92 |
# File 'lib/clickwrap/localized_text.rb', line 90 def locale @locale end |