Class: Herb::Errors::RenderAmbiguousLocalsError
- 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 collapse
-
#partial ⇒ Object
readonly
| partial: String?, | }.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(type, location, message, partial) ⇒ RenderAmbiguousLocalsError
constructor
: (String, Location?, String, String) -> void.
-
#inspect ⇒ Object
: () -> String.
-
#to_hash ⇒ Object
: () -> serialized_render_ambiguous_locals_error.
-
#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, #to_json
Constructor Details
#initialize(type, location, message, partial) ⇒ RenderAmbiguousLocalsError
: (String, Location?, String, String) -> void
1025 1026 1027 1028 |
# File 'lib/herb/errors.rb', line 1025 def initialize(type, location, , partial) super(type, location, ) @partial = partial end |
Instance Attribute Details
#partial ⇒ Object (readonly)
| partial: String?, | }
1022 1023 1024 |
# File 'lib/herb/errors.rb', line 1022 def partial @partial end |
Instance Method Details
#inspect ⇒ Object
: () -> String
1031 1032 1033 |
# File 'lib/herb/errors.rb', line 1031 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#to_hash ⇒ Object
: () -> serialized_render_ambiguous_locals_error
1036 1037 1038 1039 1040 |
# File 'lib/herb/errors.rb', line 1036 def to_hash super.merge( partial: partial ) #: Herb::serialized_render_ambiguous_locals_error end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 |
# File 'lib/herb/errors.rb', line 1043 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 += white("└── partial: #{green(partial.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |