Class: Herb::Errors::StrictLocalsMissingParenthesisError
- 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
-
#rest ⇒ Object
readonly
| rest: String?, | }.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(type, location, message, rest) ⇒ StrictLocalsMissingParenthesisError
constructor
: (String, Location?, String, String) -> void.
-
#inspect ⇒ Object
: () -> String.
-
#to_hash ⇒ Object
: () -> serialized_strict_locals_missing_parenthesis_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, rest) ⇒ StrictLocalsMissingParenthesisError
: (String, Location?, String, String) -> void
1387 1388 1389 1390 |
# File 'lib/herb/errors.rb', line 1387 def initialize(type, location, , rest) super(type, location, ) @rest = rest end |
Instance Attribute Details
#rest ⇒ Object (readonly)
| rest: String?, | }
1384 1385 1386 |
# File 'lib/herb/errors.rb', line 1384 def rest @rest end |
Instance Method Details
#inspect ⇒ Object
: () -> String
1393 1394 1395 |
# File 'lib/herb/errors.rb', line 1393 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#to_hash ⇒ Object
: () -> serialized_strict_locals_missing_parenthesis_error
1398 1399 1400 1401 1402 |
# File 'lib/herb/errors.rb', line 1398 def to_hash super.merge( rest: rest ) #: Herb::serialized_strict_locals_missing_parenthesis_error end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ Object
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'lib/herb/errors.rb', line 1405 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("└── rest: #{green(rest.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |