Exception: Converty::UnitError

Inherits:
Error
  • Object
show all
Defined in:
lib/converty.rb

Overview

Thrown when a non-existant unit type is passed into the from and/or to param when converting.

Instance Method Summary collapse

Constructor Details

#initialize(units) ⇒ UnitError

Returns a new instance of UnitError.



23
24
25
26
# File 'lib/converty.rb', line 23

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