Class: Moxml::Adapter::CustomizedLeptris::TextSegment
- Inherits:
-
Object
- Object
- Moxml::Adapter::CustomizedLeptris::TextSegment
- Defined in:
- lib/moxml/adapter/customized_leptris/text_segment.rb
Overview
A text run split out of a native text node that carried entity markers. Value object: the moxml contract exposes text nodes as separate children around entity references, while libleptris stores them as one marker-bearing text node.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(content, parent = nil) ⇒ TextSegment
constructor
A new instance of TextSegment.
Constructor Details
#initialize(content, parent = nil) ⇒ TextSegment
Returns a new instance of TextSegment.
15 16 17 18 |
# File 'lib/moxml/adapter/customized_leptris/text_segment.rb', line 15 def initialize(content, parent = nil) @content = content @parent = parent end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
13 14 15 |
# File 'lib/moxml/adapter/customized_leptris/text_segment.rb', line 13 def content @content end |
#parent ⇒ Object
Returns the value of attribute parent.
11 12 13 |
# File 'lib/moxml/adapter/customized_leptris/text_segment.rb', line 11 def parent @parent end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 |
# File 'lib/moxml/adapter/customized_leptris/text_segment.rb', line 20 def ==(other) other.is_a?(self.class) && content == other.content end |