Class: Fbtxt::Parser::Heading2

Inherits:
Struct
  • Object
show all
Defined in:
lib/fbtxt/parser/parse_tree.rb

Overview

Heading1

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



176
177
178
# File 'lib/fbtxt/parser/parse_tree.rb', line 176

def text
  @text
end

Instance Method Details

#as_jsonObject



177
178
179
# File 'lib/fbtxt/parser/parse_tree.rb', line 177

def as_json(*)
  ['<Heading2>', { 'text' => text.as_json }]
end

#pretty_print(q) ⇒ Object



181
182
183
184
185
# File 'lib/fbtxt/parser/parse_tree.rb', line 181

def pretty_print( q )
  q.group( 4, '<Heading2 ', '>' ) do
    q.text( text )
  end
end