Class: Herb::Errors::ConditionalElementConditionMismatchError
- 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
-
#close_column ⇒ Object
readonly
: Integer?.
-
#close_condition ⇒ Object
readonly
: String?.
-
#close_line ⇒ Object
readonly
: Integer?.
-
#open_column ⇒ Object
readonly
: Integer?.
-
#open_condition ⇒ Object
readonly
: String?.
-
#open_line ⇒ Object
readonly
: Integer?.
-
#tag_name ⇒ Object
readonly
| tag_name: String?, | open_condition: String?, | open_line: Integer?, | open_column: Integer?, | close_condition: String?, | close_line: Integer?, | close_column: Integer?, | }.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(type, location, message, tag_name, open_condition, open_line, open_column, close_condition, close_line, close_column) ⇒ ConditionalElementConditionMismatchError
constructor
: (String, Location?, String, String, String, Integer, Integer, String, Integer, Integer) -> void.
-
#inspect ⇒ Object
: () -> String.
-
#to_hash ⇒ Object
: () -> serialized_conditional_element_condition_mismatch_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, tag_name, open_condition, open_line, open_column, close_condition, close_line, close_column) ⇒ ConditionalElementConditionMismatchError
: (String, Location?, String, String, String, Integer, Integer, String, Integer, Integer) -> void
605 606 607 608 609 610 611 612 613 614 |
# File 'lib/herb/errors.rb', line 605 def initialize(type, location, , tag_name, open_condition, open_line, open_column, close_condition, close_line, close_column) super(type, location, ) @tag_name = tag_name @open_condition = open_condition @open_line = open_line @open_column = open_column @close_condition = close_condition @close_line = close_line @close_column = close_column end |
Instance Attribute Details
#close_column ⇒ Object (readonly)
: Integer?
602 603 604 |
# File 'lib/herb/errors.rb', line 602 def close_column @close_column end |
#close_condition ⇒ Object (readonly)
: String?
600 601 602 |
# File 'lib/herb/errors.rb', line 600 def close_condition @close_condition end |
#close_line ⇒ Object (readonly)
: Integer?
601 602 603 |
# File 'lib/herb/errors.rb', line 601 def close_line @close_line end |
#open_column ⇒ Object (readonly)
: Integer?
599 600 601 |
# File 'lib/herb/errors.rb', line 599 def open_column @open_column end |
#open_condition ⇒ Object (readonly)
: String?
597 598 599 |
# File 'lib/herb/errors.rb', line 597 def open_condition @open_condition end |
#open_line ⇒ Object (readonly)
: Integer?
598 599 600 |
# File 'lib/herb/errors.rb', line 598 def open_line @open_line end |
#tag_name ⇒ Object (readonly)
| tag_name: String?, | open_condition: String?, | open_line: Integer?, | open_column: Integer?, | close_condition: String?, | close_line: Integer?, | close_column: Integer?, | }
596 597 598 |
# File 'lib/herb/errors.rb', line 596 def tag_name @tag_name end |
Instance Method Details
#inspect ⇒ Object
: () -> String
617 618 619 |
# File 'lib/herb/errors.rb', line 617 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#to_hash ⇒ Object
: () -> serialized_conditional_element_condition_mismatch_error
622 623 624 625 626 627 628 629 630 631 632 |
# File 'lib/herb/errors.rb', line 622 def to_hash super.merge( tag_name: tag_name, open_condition: open_condition, open_line: open_line, open_column: open_column, close_condition: close_condition, close_line: close_line, close_column: close_column ) #: Herb::serialized_conditional_element_condition_mismatch_error end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
# File 'lib/herb/errors.rb', line 635 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("├── tag_name: #{green(tag_name.inspect)}\n") output += white("├── open_condition: #{green(open_condition.inspect)}\n") output += white("├── open_line: #{green(open_line.inspect)}\n") output += white("├── open_column: #{green(open_column.inspect)}\n") output += white("├── close_condition: #{green(close_condition.inspect)}\n") output += white("├── close_line: #{green(close_line.inspect)}\n") output += white("└── close_column: #{green(close_column.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |