Class: Strling::Core::Anchor
Overview
Represents an anchor position assertion.
Anchors match positions rather than characters (start/end of string, word boundaries, etc.).
Instance Attribute Summary collapse
-
#at ⇒ String
The anchor type: “Start”, “End”, “WordBoundary”, “NotWordBoundary”, or Absolute* variants.
Instance Method Summary collapse
-
#initialize(at) ⇒ Anchor
constructor
A new instance of Anchor.
- #to_dict ⇒ Object
Constructor Details
#initialize(at) ⇒ Anchor
Returns a new instance of Anchor.
174 175 176 |
# File 'lib/strling/core/nodes.rb', line 174 def initialize(at) @at = at end |
Instance Attribute Details
#at ⇒ String
Returns The anchor type: “Start”, “End”, “WordBoundary”, “NotWordBoundary”, or Absolute* variants.
171 172 173 |
# File 'lib/strling/core/nodes.rb', line 171 def at @at end |
Instance Method Details
#to_dict ⇒ Object
178 179 180 |
# File 'lib/strling/core/nodes.rb', line 178 def to_dict { 'kind' => 'Anchor', 'at' => at } end |