Exception: Convertio::NoUnitError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/convertio.rb

Overview

Raise error if unit is not found

Instance Method Summary collapse

Constructor Details

#initialize(units) ⇒ NoUnitError

Returns a new instance of NoUnitError.



11
12
13
14
# File 'lib/convertio.rb', line 11

def initialize(units)
  error_message = units.map { |unit| "#{unit} is an invalid type" }.join(", ")
  super(error_message)
end