2
4

More than 5 years have passed since last update.

Rubyのメソッドの動的な呼び出し

Posted at

その1
メソッドを変数で動的に呼び出す
.send(メソッド名のシンボル)

symbol = :method1
instance.send symbol
symbol = :method2
instance.send symbol

重い処理?

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4