Method: Hanami::Utils::Kernel.Hash
- Defined in:
- lib/hanami/utils/kernel.rb
permalink .Hash(arg) ⇒ Hash
Coerces the argument to be a Hash.
214 215 216 217 218 219 220 221 222 |
# File 'lib/hanami/utils/kernel.rb', line 214 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 |