Ruby IRB 彩蛋

brookepowell · February 05, 2021 · Last by aaline57963 replied at February 18, 2021 · 669 hits

需要 ruby 大于等于 2.7

irb
IRB.send :easter_egg, :dancing

2.7.2 刚试了下只输入 IRB.send :easter_egg 返回随机结果,可能是静态的也可能是动态的

Reply to SuMingXuan

嗯,共有两种,如果不填 type,就随机。

IRB.send :easter_egg, :logo
IRB.send :easter_egg, :dancing

2.7.0p0 返回了 NoMethodError (undefined method 'easter_egg' for IRB:Module) 😂

You need to Sign in before reply, if you don't have an account, please Sign up first.