Slide 28
Slide 28 text
6TFAMPDBM@WBSJBCMF@TFUA
class Framework
def initialize
hard_config = ''
@config_for_debug = "#{self.class}: #{hard_config}"
end
def config
@config_for_debug
end
end
p Framework.new.config #=> ''
class Application < Framework
def initialize
trace = TracePoint.trace(:line) do |tp|
tp.binding.local_variable_set(:hard_config, '')
end
super
trace.disable
end
end
Specify the event to
evaluate the expression
with `trace(:line)`