Class: Fbtxt::Parser::Sub

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

Overview

fix-fix-fix change :sub to :lineup - why? why not?

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#minuteObject

Returns the value of attribute minute

Returns:

  • (Object)

    the current value of minute



243
244
245
# File 'lib/fbtxt/parser/parse_tree-props.rb', line 243

def minute
  @minute
end

#subObject

Returns the value of attribute sub

Returns:

  • (Object)

    the current value of sub



243
244
245
# File 'lib/fbtxt/parser/parse_tree-props.rb', line 243

def sub
  @sub
end

Instance Method Details

#as_jsonObject



244
245
246
247
248
249
250
# File 'lib/fbtxt/parser/parse_tree-props.rb', line 244

def as_json(*)
  h = { 'lineup' => sub.as_json }
  h['minute'] =  minute.as_json       if minute

  ## ['<Sub>', h]
  h  # note - return "inline" json object (not tagged array with json object)
end

#pretty_print(q) ⇒ Object



252
253
254
255
256
257
# File 'lib/fbtxt/parser/parse_tree-props.rb', line 252

def pretty_print( q )
  q.group( 0, '(', ')') do
     q.text( "#{minute.to_s} " )   if minute
     q.pp( sub )
  end
end