Class: Kozo::Types::Hash
- Inherits:
-
Kozo::Type
- Object
- Kozo::Type
- Kozo::Types::Hash
- Defined in:
- lib/kozo/types/hash.rb
Class Method Summary collapse
Methods inherited from Kozo::Type
Class Method Details
.cast(value) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/kozo/types/hash.rb', line 6 def self.cast(value) return unless value return value if value.is_a?(::Hash) value.to_h rescue TypeError, NoMethodError => e raise ArgumentError, e end |