module FileIO

Importing and Outputting Files

Public Class Methods

unpack_objects(arg) click to toggle source
# File modules/file_io.rb, line 128
def self.unpack_objects(arg)
        return arg if arg.is_a? Numeric
        return arg if arg.is_a? String
        raise "nil" if arg.nil?

        begin
                arg.each do |bucket|
                        hash_objs = []
                        bucket[:objects].each do |object|
                                hash = {}
                                object.instance_variables.each {|var| hash[var.to_s.delete("@")] = object.instance_variable_get(var) }
                                hash_objs << hash
                        end
                        bucket[:objects] = hash_objs
                end
                return arg
        rescue
                puts $!
                raise "error"
        end
end