Class: AI::Message
- Inherits:
-
Hash
- Object
- Hash
- AI::Message
- Defined in:
- lib/ai/message.rb
Instance Method Summary collapse
- #inspect ⇒ Object
- #pretty_inspect ⇒ Object
-
#pretty_print(q) ⇒ Object
IRB’s ColorPrinter calls pretty_print and re-colorizes text, which escapes our ANSI codes.
- #to_html ⇒ Object
Instance Method Details
#inspect ⇒ Object
5 6 7 |
# File 'lib/ai/message.rb', line 5 def inspect AI.amazing_print(display_hash, plain: !$stdout.tty?, index: false) end |
#pretty_inspect ⇒ Object
9 10 11 |
# File 'lib/ai/message.rb', line 9 def pretty_inspect "#{inspect}\n" end |
#pretty_print(q) ⇒ Object
IRB’s ColorPrinter calls pretty_print and re-colorizes text, which escapes our ANSI codes. Write directly to output to bypass.
15 16 17 |
# File 'lib/ai/message.rb', line 15 def pretty_print(q) q.output << inspect end |
#to_html ⇒ Object
19 20 21 |
# File 'lib/ai/message.rb', line 19 def to_html AI.wrap_html(AI.amazing_print(display_hash, html: true, index: false)) end |