`instance_variable_defined?(instance_variable_name)` would be more appropriate.