Sha256: 641afb00dfda1c57b5c88688cb9db40f2354411894effaa4d5843ee29eee9e09
Contents?: true
Size: 604 Bytes
Versions: 1
Compression:
Stored size: 604 Bytes
Contents
module Enotas class Util OBJECT_TYPES = { } def self.get_object_type(type) object_type = Enotas::EnotasObject object_type = OBJECT_TYPES[type] if OBJECT_TYPES[type] object_type end def self.symbolize_names(object) case object when Hash new = {} object.each do |key, value| key = (key.to_sym rescue key) || key new[key] = symbolize_names(value) end new when Array object.map { |value| symbolize_names(value) } else object end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
enotas-0.1.3 | lib/enotas/util.rb |