We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby3.1.4で実行して試したところ各選択肢の実行結果が違っていました。 prep-test/gold_answers_ja.md at dccfa77b6d3e409b7d818f4396fecf194f4b5839 · ruby-association/prep-test
解説の修正(もしくは問題の修正?)をお願いしたく存じます。
class Speaker @message = "Hello!" class << self @message = "Howdy!" def speak @message end end end __(1)__ # [実行結果] # Hello!
A: puts Speaker.speak B: puts Speaker.singleton_class.speak C: puts Speaker.instance_variable_get(:@message) D: puts Speaker.singleton_class.instance_variable_get(:@message)
A: Hello! B: Howdy! C: Hello! D: nil
A: Hello! B: <main>': undefined method speak' for #Class:Speaker (NoMethodError) C: Hello! D: Howdy!
<main>': undefined method
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Ruby3.1.4で実行して試したところ各選択肢の実行結果が違っていました。
prep-test/gold_answers_ja.md at dccfa77b6d3e409b7d818f4396fecf194f4b5839 · ruby-association/prep-test
解説の修正(もしくは問題の修正?)をお願いしたく存じます。
コード
選択肢
A: puts Speaker.speak
B: puts Speaker.singleton_class.speak
C: puts Speaker.instance_variable_get(:@message)
D: puts Speaker.singleton_class.instance_variable_get(:@message)
解答
A: Hello!
B: Howdy!
C: Hello!
D: nil
実際の実行結果
A: Hello!
B:
<main>': undefined method
speak' for #Class:Speaker (NoMethodError)C: Hello!
D: Howdy!
The text was updated successfully, but these errors were encountered: