Exception: WitBot::LowConfidenceError
- Inherits:
-
WitBotError
- Object
- StandardError
- WitBotError
- WitBot::LowConfidenceError
- Defined in:
- lib/wit_bot/errors/low_confidence_error.rb
Instance Attribute Summary collapse
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#minimum_confidence ⇒ Object
readonly
Returns the value of attribute minimum_confidence.
-
#outcome ⇒ Object
readonly
Returns the value of attribute outcome.
Instance Method Summary collapse
-
#initialize(outcome, minimum_confidence = config.minimum_confidence) ⇒ LowConfidenceError
constructor
A new instance of LowConfidenceError.
- #to_s ⇒ Object
Constructor Details
#initialize(outcome, minimum_confidence = config.minimum_confidence) ⇒ LowConfidenceError
Returns a new instance of LowConfidenceError.
5 6 7 8 9 10 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 5 def initialize(outcome, minimum_confidence=config.minimum_confidence) @outcome = outcome @message = outcome. @confidence = outcome.confidence @minimum_confidence = minimum_confidence end |
Instance Attribute Details
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
3 4 5 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 3 def confidence @confidence end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 3 def @message end |
#minimum_confidence ⇒ Object (readonly)
Returns the value of attribute minimum_confidence.
3 4 5 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 3 def minimum_confidence @minimum_confidence end |
#outcome ⇒ Object (readonly)
Returns the value of attribute outcome.
3 4 5 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 3 def outcome @outcome end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/wit_bot/errors/low_confidence_error.rb', line 12 def to_s "Confidence (#{confidence}) is lower then the minimum (#{minimum_confidence})" end |