class PowerAssert::Inspector
公共类方法
new(value, indent) 点击切换源代码
# File power_assert-2.0.5/lib/power_assert/inspector.rb, line 42 def initialize(value, indent) @value = value @indent = indent end
公共实例方法
inspect() 点击切换源代码
# File power_assert-2.0.5/lib/power_assert/inspector.rb, line 47 def inspect if PowerAssert.configuration.colorize_message if PowerAssert.configuration.inspector == :pp console_width = IO.respond_to?(:console_size) ? IO.console_size[1] : 80 width = [console_width - 1 - @indent, 10].max IRB::ColorPrinter.pp(@value, +'', width) else IRB::Color.colorize_code(@value.to_s, ignore_error: true) end else if PowerAssert.configuration.inspector == :pp PP.pp(@value, +'') else @value.inspect end end end