Class: Herb::Errors::MissingERBEndTagError
- 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
-
#keyword ⇒ Object
readonly
| keyword: String?, | }.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(type, location, message, keyword) ⇒ MissingERBEndTagError
constructor
: (String, Location?, String, String) -> void.
-
#inspect ⇒ Object
: () -> String.
-
#to_hash ⇒ Object
: () -> serialized_missing_erb_end_tag_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, keyword) ⇒ MissingERBEndTagError
: (String, Location?, String, String) -> void
470 471 472 473 |
# File 'lib/herb/errors.rb', line 470 def initialize(type, location, , keyword) super(type, location, ) @keyword = keyword end |
Instance Attribute Details
#keyword ⇒ Object (readonly)
| keyword: String?, | }
467 468 469 |
# File 'lib/herb/errors.rb', line 467 def keyword @keyword end |
Instance Method Details
#inspect ⇒ Object
: () -> String
476 477 478 |
# File 'lib/herb/errors.rb', line 476 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#to_hash ⇒ Object
: () -> serialized_missing_erb_end_tag_error
481 482 483 484 485 |
# File 'lib/herb/errors.rb', line 481 def to_hash super.merge( keyword: keyword ) #: Herb::serialized_missing_erb_end_tag_error end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
488 489 490 491 492 493 494 495 496 497 |
# File 'lib/herb/errors.rb', line 488 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("└── keyword: #{green(keyword.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |