Class: FormattedString
- Defined in:
- lib/asciidoctor/pdf/formatted_string.rb
Instance Attribute Summary collapse
-
#fragments ⇒ Object
readonly
Returns the value of attribute fragments.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(fragments) ⇒ FormattedString
constructor
A new instance of FormattedString.
Methods inherited from String
#as_pdf, #pred, #to_pdf_object
Constructor Details
#initialize(fragments) ⇒ FormattedString
Returns a new instance of FormattedString.
6 7 8 |
# File 'lib/asciidoctor/pdf/formatted_string.rb', line 6 def initialize fragments super [].tap {|accum| (@fragments = fragments).each {|it| accum << it[:text] } }.join end |
Instance Attribute Details
#fragments ⇒ Object (readonly)
Returns the value of attribute fragments.
4 5 6 |
# File 'lib/asciidoctor/pdf/formatted_string.rb', line 4 def fragments @fragments end |
Instance Method Details
#eql?(other) ⇒ Boolean
10 11 12 |
# File 'lib/asciidoctor/pdf/formatted_string.rb', line 10 def eql? other super && (FormattedString === other ? (@fragments ||= nil) == other.fragments : true) end |