Class: SyntaxTree::RegexpContent
Overview
RegexpContent represents the body of a regular expression.
/.+ #{pattern} .+/
In the example above, a RegexpContent node represents everything contained within the forward slashes.
Instance Attribute Summary collapse
-
#beginning ⇒ Object
readonly
- String
-
the opening of the regular expression.
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
-
#parts ⇒ Object
readonly
- Array[ StringDVar | StringEmbExpr | TStringContent ]
-
the parts of the regular expression.
Instance Method Summary collapse
-
#initialize(beginning:, parts:, location:) ⇒ RegexpContent
constructor
A new instance of RegexpContent.
Methods inherited from Node
#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(beginning:, parts:, location:) ⇒ RegexpContent
Returns a new instance of RegexpContent.
8574 8575 8576 8577 8578 |
# File 'lib/syntax_tree/node.rb', line 8574 def initialize(beginning:, parts:, location:) @beginning = beginning @parts = parts @location = location end |
Instance Attribute Details
#beginning ⇒ Object (readonly)
- String
-
the opening of the regular expression
8565 8566 8567 |
# File 'lib/syntax_tree/node.rb', line 8565 def beginning @beginning end |
#location ⇒ Object (readonly)
- Location
-
the location of this node
8572 8573 8574 |
# File 'lib/syntax_tree/node.rb', line 8572 def location @location end |
#parts ⇒ Object (readonly)
- Array[ StringDVar | StringEmbExpr | TStringContent ]
-
the parts of the
regular expression
8569 8570 8571 |
# File 'lib/syntax_tree/node.rb', line 8569 def parts @parts end |