Module: Kaicho::Util
- Defined in:
- lib/kaicho/util.rb
Overview
A utility module for Kaicho. Don’t touch this stuff!
Class Method Summary collapse
-
.check_type(expected, got) ⇒ True
raise an exception if a type is invalid.
Class Method Details
.check_type(expected, got) ⇒ True
raise an exception if a type is invalid
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kaicho/util.rb', line 13 def check_type(expected, got) unless expected === got raise( TypeError, "expected #{expected.name} got #{got}:#{got.class.name}" ) end true end |