Class: Prolog::Services::ReplaceContent::Splitter::Symmetric
- Inherits:
-
Object
- Object
- Prolog::Services::ReplaceContent::Splitter::Symmetric
- 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
-
#inner ⇒ Object
readonly
Returns the value of attribute inner.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(content:, endpoints:, marker: DEFAULT_MARKER) ⇒ Symmetric
constructor
class Prolog::Services::ReplaceContent::ContentSplitter::Parts.
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
#inner ⇒ Object (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 |
#source ⇒ Object (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 |