Method: Hanami::Utils::Kernel.Hash
- Defined in:
- lib/hanami/utils/kernel.rb
.Hash(arg) ⇒ Hash
Coerces the argument to be a Hash.
213 214 215 216 217 218 219 220 221 |
# File 'lib/hanami/utils/kernel.rb', line 213 def self.Hash(arg) if arg.respond_to?(:to_h) arg.to_h else super end rescue NoMethodError raise TypeError.new "can't convert #{inspect_type_error(arg)}into Hash" end |