Class: Prolog::Services::ReplaceContent::Splitter::Symmetric

Inherits:
Object
  • Object
show all
Defined in:
lib/prolog/services/replace_content/splitter/symmetric.rb

Overview

A “symmetric” splitter inserts the same marker text before and after the selected range. This defaults to an empty string, but can be any simple string.

Defined Under Namespace

Classes: Parts

Constant Summary collapse

DEFAULT_MARKER =
''

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, endpoints:, marker: DEFAULT_MARKER) ⇒ Symmetric

class Prolog::Services::ReplaceContent::ContentSplitter::Parts



51
52
53
54
55
# File 'lib/prolog/services/replace_content/splitter/symmetric.rb', line 51

def initialize(content:, endpoints:, marker: DEFAULT_MARKER)
  @inner = Internals.build_inner(content, endpoints, marker)
  @source = rebuild_source(content, endpoints)
  self
end

Instance Attribute Details

#innerObject (readonly)

Returns the value of attribute inner.



14
15
16
# File 'lib/prolog/services/replace_content/splitter/symmetric.rb', line 14

def inner
  @inner
end

#sourceObject (readonly)

Returns the value of attribute source.



14
15
16
# File 'lib/prolog/services/replace_content/splitter/symmetric.rb', line 14

def source
  @source
end