logo
  • 教程列表
  • SO官方文檔
  • 動態評估
    • 例項評估
    • 評估字串
    • 評估繫結內部
    • 從字串動態建立方法
  1. StackOverflow 文件
  2. Ruby Language 教程
  3. 動態評估
  4. 評估字串

評估字串

Created: November-22, 2018

任何 String 都可以在執行時進行評估。

class Example
  def self.foo
    :foo
  end
end

eval "Example.foo" #=> :foo
  • 評估繫結內部
  • 例項評估

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明