Module: SimpleAssertType
- Included in:
- Kernel
- Defined in:
- lib/simple_assert_type.rb,
lib/simple_assert_type/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
Class Method Details
.extended(mod) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/simple_assert_type.rb', line 4 def self.extended(mod) mod.module_eval do def assert_type(value, type) return true if value.is_a?(type) raise ArgumentError, "#{type} expected, got #{value.class}" end end end |