ruby 重构其他代码的结果,使用时间库和功能proc。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 重构其他代码的结果,使用时间库和功能proc。相关的知识,希望对你有一定的参考价值。

require 'time'
get_time = ->(t) { [t.iso8601, t.usec] }
report = 'something to report with a detailed time: %s'
puts report % get_time[Time.now]


以上是关于ruby 重构其他代码的结果,使用时间库和功能proc。的主要内容,如果未能解决你的问题,请参考以下文章