Method: Lotus::Utils::Kernel.Hash

Defined in:
lib/lotus/utils/kernel.rb,
lib/lotus/utils/kernel.rb

.Hash(arg) ⇒ Object

Since:

  • 0.1.1



201
202
203
204
205
206
207
208
209
# File 'lib/lotus/utils/kernel.rb', line 201

def self.Hash(arg)
  if arg.respond_to?(:to_h)
    arg.to_h
  else
    super(arg)
  end
rescue NoMethodError
  raise TypeError.new "can't convert #{inspect_type_error(arg)}into Hash"
end