Class: Strling::Core::Anchor

Inherits:
Node
  • Object
show all
Defined in:
lib/strling/core/nodes.rb

Overview

Represents an anchor position assertion.

Anchors match positions rather than characters (start/end of string, word boundaries, etc.).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(at) ⇒ Anchor

Returns a new instance of Anchor.

Parameters:

  • at (String)

    The anchor type



174
175
176
# File 'lib/strling/core/nodes.rb', line 174

def initialize(at)
  @at = at
end

Instance Attribute Details

#atString

Returns The anchor type: “Start”, “End”, “WordBoundary”, “NotWordBoundary”, or Absolute* variants.

Returns:

  • (String)

    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_dictObject



178
179
180
# File 'lib/strling/core/nodes.rb', line 178

def to_dict
  { 'kind' => 'Anchor', 'at' => at }
end