class PowerAssert::TraceContext
公共类方法
new(binding) 点击以切换源代码
调用超类方法
PowerAssert::Context::new
# File power_assert-2.0.5/lib/power_assert/context.rb, line 206 def initialize(binding) target_frame, *base = PowerAssert.app_caller_locations super(base.length) path = target_frame.path lineno = target_frame.lineno if File.exist?(path) line = File.open(path) {|fp| fp.each_line.drop(lineno - 1).first } @parser = Parser.new(line, path, lineno, binding) else @parser = Parser::DUMMY end end
公共实例方法
disable() 点击以切换源代码
# File power_assert-2.0.5/lib/power_assert/context.rb, line 224 def disable @trace_return.disable end
enable() 点击以切换源代码
# File power_assert-2.0.5/lib/power_assert/context.rb, line 219 def enable @fired = true @trace_return.enable end
enabled?() 点击以切换源代码
# File power_assert-2.0.5/lib/power_assert/context.rb, line 228 def enabled? @trace_return.enabled? end