Suppose I have a class A
A
class A attr_accessor :x, :y def initialize(x,y) @x, @y = x, y end end
How can I get x and y attributes without knowing how exactly they were named.
x
y
E.g.
a = A.new(5,10) a.attributes # => [5, 10]