method

from_hash

Importance_0
v2_4_6 - Show latest stable - 0 notes - Class: GenericObject
from_hash(object) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File ext/json/lib/json/generic_object.rb, line 21
      def from_hash(object)
        case
        when object.respond_to?(:to_hash)
          result = new
          object.to_hash.each do |key, value|
            result[key] = from_hash(value)
          end
          result
        when object.respond_to?(:to_ary)
          object.to_ary.map { |a| from_hash(a) }
        else
          object
        end
      end
Register or log in to add new notes.