Class: Marvi::RichLine
- Inherits:
-
Object
- Object
- Marvi::RichLine
- Defined in:
- lib/marvi/document.rb
Instance Attribute Summary collapse
-
#source_line ⇒ Object
readonly
Returns the value of attribute source_line.
-
#spans ⇒ Object
readonly
Returns the value of attribute spans.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(spans = [], source_line: nil) ⇒ RichLine
constructor
A new instance of RichLine.
- #plain_text ⇒ Object
Constructor Details
#initialize(spans = [], source_line: nil) ⇒ RichLine
Returns a new instance of RichLine.
19 20 21 22 |
# File 'lib/marvi/document.rb', line 19 def initialize(spans = [], source_line: nil) @spans = spans @source_line = source_line end |
Instance Attribute Details
#source_line ⇒ Object (readonly)
Returns the value of attribute source_line.
17 18 19 |
# File 'lib/marvi/document.rb', line 17 def source_line @source_line end |
#spans ⇒ Object (readonly)
Returns the value of attribute spans.
17 18 19 |
# File 'lib/marvi/document.rb', line 17 def spans @spans end |
Class Method Details
.blank ⇒ Object
28 29 30 |
# File 'lib/marvi/document.rb', line 28 def self.blank new([]) end |
Instance Method Details
#plain_text ⇒ Object
24 25 26 |
# File 'lib/marvi/document.rb', line 24 def plain_text @spans.map(&:text).join end |