class A attr_accessor :xenda = A.newa.respond_to? :x # => truea.respond_to? :x= # => truea.respond_to? :y # => false