Exception: Clickwrap::AnswerInvalid
- Inherits:
-
CaptureRefused
- Object
- StandardError
- Error
- CaptureRefused
- Clickwrap::AnswerInvalid
- Defined in:
- lib/clickwrap/errors.rb
Overview
Raised when a required answer is missing or an answer is not one of the choices the server offered.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#statement_key ⇒ Object
readonly
Returns the value of attribute statement_key.
Instance Method Summary collapse
-
#initialize(message = nil, statement_key: nil, reason: nil) ⇒ AnswerInvalid
constructor
A new instance of AnswerInvalid.
- #user_facing_message ⇒ Object
Constructor Details
#initialize(message = nil, statement_key: nil, reason: nil) ⇒ AnswerInvalid
Returns a new instance of AnswerInvalid.
80 81 82 83 84 |
# File 'lib/clickwrap/errors.rb', line 80 def initialize( = nil, statement_key: nil, reason: nil) @statement_key = statement_key @reason = reason super( || "The submitted answer for #{statement_key.inspect} was not accepted") end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
78 79 80 |
# File 'lib/clickwrap/errors.rb', line 78 def reason @reason end |
#statement_key ⇒ Object (readonly)
Returns the value of attribute statement_key.
78 79 80 |
# File 'lib/clickwrap/errors.rb', line 78 def statement_key @statement_key end |
Instance Method Details
#user_facing_message ⇒ Object
86 87 88 |
# File 'lib/clickwrap/errors.rb', line 86 def I18n.t("clickwrap.errors.required_statement") end |