Class: AsciiChem::Model::Text
Overview
A run of plain text — operators, whitespace, anything the grammar doesn't promote to a typed node.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(content:) ⇒ Text
constructor
A new instance of Text.
- #to_s ⇒ Object
- #value_attributes ⇒ Object
Methods inherited from Node
#==, #accept, #children, #diagnostic_label, #hash, short_name, #to_cml, #to_html, #to_latex, #to_mathml, #to_svg, #to_text
Constructor Details
#initialize(content:) ⇒ Text
Returns a new instance of Text.
10 11 12 |
# File 'lib/asciichem/model/text.rb', line 10 def initialize(content:) @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
8 9 10 |
# File 'lib/asciichem/model/text.rb', line 8 def content @content end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/asciichem/model/text.rb', line 18 def to_s "Text(#{content.inspect})" end |
#value_attributes ⇒ Object
14 15 16 |
# File 'lib/asciichem/model/text.rb', line 14 def value_attributes { content: content } end |