Class: Herb::Errors::RenderObjectAndCollectionError
- Includes:
- Colors
- Defined in:
- lib/herb/errors.rb,
ext/herb/error_helpers.c
Constant Summary
Constants included from Colors
Colors::CLEAR_SCREEN, Colors::HIDE_CURSOR, Colors::SHOW_CURSOR
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#inspect ⇒ Object
: () -> String.
-
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String.
Methods included from Colors
bold, bright_magenta, cyan, dimmed, enabled?, fg, fg_bg, green, magenta, red, white, yellow
Methods inherited from Error
#class_name, #error_name, #initialize, #to_hash, #to_json
Constructor Details
This class inherits a constructor from Herb::Errors::Error
Instance Method Details
#inspect ⇒ Object
: () -> String
1206 1207 1208 |
# File 'lib/herb/errors.rb', line 1206 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
1211 1212 1213 1214 1215 1216 1217 1218 1219 |
# File 'lib/herb/errors.rb', line 1211 def tree_inspect(indent: 0, depth: 0, depth_limit: 25) output = +"" output += white("@ #{bold(red(error_name))} #{dimmed("(location: #{location&.tree_inspect})\n")}") output += white("└── message: #{green(.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |