Exception: Appydave::Tools::Dam::BrandNotFoundError
- Defined in:
- lib/appydave/tools/dam/errors.rb
Overview
Raised when brand directory not found
Instance Method Summary collapse
-
#initialize(brand, available_brands = nil, suggestions = nil) ⇒ BrandNotFoundError
constructor
A new instance of BrandNotFoundError.
Constructor Details
#initialize(brand, available_brands = nil, suggestions = nil) ⇒ BrandNotFoundError
Returns a new instance of BrandNotFoundError.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/appydave/tools/dam/errors.rb', line 11 def initialize(brand, available_brands = nil, suggestions = nil) = "Brand directory not found: #{brand}" # Add fuzzy match suggestions if provided if suggestions && !suggestions.empty? += "\n\nDid you mean?" suggestions.each { |s| += "\n - #{s}" } end # Add full list of available brands += "\n\nAvailable brands:\n#{available_brands}" if available_brands && !available_brands.empty? super() end |