lib/megam/core/json_compat.rb
def map_to_rb_obj(json_obj)
        case json_obj
        when Hash
          mapped_hash = map_hash_to_rb_obj(json_obj)
          if json_obj.has_key?(JSON_CLAZ) && (class_to_inflate = class_for_json_class(json_obj[JSON_CLAZ]))
          class_to_inflate.json_create(mapped_hash)
          else
          mapped_hash
          end
        when Array
          json_obj.map {|e| map_to_rb_obj(e) }
        else
        json_obj
        end
      end
# Look at an object that's a basic type (from json parse) and convert it
# to an instance of Megam classes if desired.
Look at an object that's a basic type (from json parse) and convert it
to an instance of Megam classes if desired.
Look at an object that ' s a basic type ( from json parse ) and convert it to an instance of Megam classes if desired .
def map_to_rb_obj(json_obj)
        case json_obj
        when Hash
          mapped_hash = map_hash_to_rb_obj(json_obj)
          if json_obj.has_key?(JSON_CLAZ) && (class_to_inflate = class_for_json_class(json_obj[JSON_CLAZ]))
          class_to_inflate.json_create(mapped_hash)
          else
          mapped_hash
          end
        when Array
          json_obj.map {|e| map_to_rb_obj(e) }
        else
        json_obj
        end
      end
def map_to_rb_obj ( json_obj ) case json_obj when Hash mapped_hash = map_hash_to_rb_obj ( json_obj ) if json_obj . has_key? ( JSON_CLAZ ) && ( class_to_inflate = class_for_json_class ( json_obj [ JSON_CLAZ ] ) ) class_to_inflate . json_create ( mapped_hash ) else mapped_hash end when Array json_obj . map { | e | map_to_rb_obj ( e ) } else json_obj end end
Look at an object that's a basic type (from json parse) and convert it
to an instance of Megam classes if desired.
Look at an object that ' s a basic type ( from json parse ) and convert it to an instance of Megam classes if desired .
json_obj