daqing
V2EX  ›  Ruby

你真的理解instance_eval, class_eval和define_method吗?

  •  
  •   daqing · Apr 22, 2011 · 7285 views
    This topic created in 5675 days ago, the information mentioned may be changed or developed.
    https://gist.github.com/936136

    请问a, b, c, d四个方法,分别是实例方法,还是类方法呢?
    2 replies  •  1970-01-01 08:00:00 +08:00
    iwinux
    iwinux
    Apr 29, 2011
    1
    a 是 Class 的类方法
    b 是 Test 的类方法
    c 是 Test 的实例方法
    d 是 Test 的类方法

    https://gist.github.com/947384
    lychee
    lychee
    Apr 29, 2011
    2
    - - 来学习下 前两天正好在纠结这几个函数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1842 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 16:58 · PVG 00:58 · LAX 08:58 · JFK 11:58
    ♥ Do have faith in what you're doing.