Class: Fbtxt::Parser::Heading1
- Defined in:
- lib/fbtxt/parser/parse_tree.rb
Overview
todo/check - use a generic Heading instead of Heading1/2/3 - why? why not?
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text
164 165 166 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 164 def text @text end |
Instance Method Details
#as_json ⇒ Object
165 166 167 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 165 def as_json(*) ['<Heading1>', { 'text' => text.as_json }] end |
#pretty_print(q) ⇒ Object
169 170 171 172 173 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 169 def pretty_print( q ) q.group( 4, '<Heading1 ', '>' ) do q.text( text ) end end |