class Object

def instance_values

C.new(0, 1).instance_values # => {"x" => 0, "y" => 1}

end
end
@x, @y = x, y
def initialize(x, y)
class C

corresponding values.
Returns a hash with string keys that maps instance variable names without "@" to their
def instance_values
  Hash[instance_variables.map { |name| [name[1..-1], instance_variable_get(name)] }]
end