私はおそらく何かばかげたことをしているのですが、それが何であるかわかりません。
このプログラムから私が見ている出力は
foo
test
私が期待しているのは
foo
abc
test
誰かがここで明らかに間違っていると思いますか?
class Foo
def initialize(l)
@label = l
end
def label
@label
end
def abc
@abc
end
def abc=(abc)
@abc
end
end
foo = Foo.new("foo")
foo.abc=("abc")
puts foo.label
puts foo.abc
puts "test"