Class: SportDb::Parser::Heading1

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

Overview

todo/check - use a generic Heading instead of Heading1/2/3 - why? why not?

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



164
165
166
# File 'lib/sportdb/parser/parse_tree.rb', line 164

def text
  @text
end

Instance Method Details

#as_jsonObject



165
166
167
# File 'lib/sportdb/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/sportdb/parser/parse_tree.rb', line 169

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