class C
def initialize(x)
puts "x は #{x} です"
puts "self.x は #{self.x} です"
end
def x
return "メソッド"
end
end

C.new('引数')

結果

x は 引数 です
self.x は メソッド です