Exception: TinyClassifier::InvalidCategory
- Inherits:
-
TinyClassifierError
- Object
- StandardError
- TinyClassifierError
- TinyClassifier::InvalidCategory
- Defined in:
- lib/tiny-classifier/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
Instance Method Summary collapse
-
#initialize(category, categories) ⇒ InvalidCategory
constructor
A new instance of InvalidCategory.
- #message ⇒ Object
Constructor Details
#initialize(category, categories) ⇒ InvalidCategory
Returns a new instance of InvalidCategory.
59 60 61 62 |
# File 'lib/tiny-classifier/errors.rb', line 59 def initialize(category, categories) @category = category @categories = categories end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
57 58 59 |
# File 'lib/tiny-classifier/errors.rb', line 57 def categories @categories end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
57 58 59 |
# File 'lib/tiny-classifier/errors.rb', line 57 def category @category end |
Instance Method Details
#message ⇒ Object
64 65 66 |
# File 'lib/tiny-classifier/errors.rb', line 64 def "You need to specify one of valid categories: #{@categories.join(", ")}" end |