    # File lib/rubygame/rect.rb, line 109
            def Rect.new_from_object(object)
                    case(object)
                    when Rect
                            return object.dup
                    when Array
                            if object.length >= 4
                                    return Rect.new(object)
                            else
                                    raise(ArgumentError,"Array does not have enough indices to be made into a Rect (%d for 4)."%object.length )
                            end
                    else
                            begin
                                    case(object.rect)
                                    when Rect
                                            return object.rect.dup
                                    when Array
                                            if object.rect.length >= 4
                                                    return Rect.new(object.rect)
                                            else
                                                    raise(ArgumentError,"Array does not have enough indices to be made into a Rect (%d for 4)."%object.rect.length )
                                            end
                                    end                         # case object.rect
                            rescue NoMethodError # if no rect.rect
                                    raise(TypeError,"Object must be a Rect or Array [x,y,w,h], or have an attribute called 'rect'. (Got %s instance.)"%object.class)
                            end
                    end # case object
            end