Class: PowerAssert::Formatter
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/power_assert/inspector.rb |
Class Method Summary
- .new(value, indent) ⇒ Formatter constructor
Instance Method Summary
Constructor Details
.new(value, indent) ⇒ Formatter
# File 'lib/power_assert/inspector.rb', line 38
def initialize(value, indent) @value = value @indent = indent end
Instance Method Details
#inspect
[ GitHub ]# File 'lib/power_assert/inspector.rb', line 43
def inspect if PowerAssert.configuration. if PowerAssert.configuration._use_pp width = [Pry::Terminal.width! - 1 - @indent, 10].max Pry::ColorPrinter.pp(@value, '', width) else Pry::Code.new(@value.inspect).highlighted end else if PowerAssert.configuration._use_pp PP.pp(@value, '') else @value.inspect end end end