Class: RaccMatchParser::MatchLineLegs

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



293
294
295
# File 'lib/sportdb/parser/racc_tree.rb', line 293

def score
  @score
end

#team1Object

Returns the value of attribute team1

Returns:

  • (Object)

    the current value of team1



293
294
295
# File 'lib/sportdb/parser/racc_tree.rb', line 293

def team1
  @team1
end

#team2Object

Returns the value of attribute team2

Returns:

  • (Object)

    the current value of team2



293
294
295
# File 'lib/sportdb/parser/racc_tree.rb', line 293

def team2
  @team2
end

Instance Method Details

#pretty_print(printer) ⇒ Object



295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/sportdb/parser/racc_tree.rb', line 295

def pretty_print( printer )
  printer.text( "<MatchLineLegs " )
  printer.text( "#{self.team1} v #{self.team2}")
  printer.breakable

  members.zip(values) do |name, value|
    next if [:team1, :team2].include?( name )
    next if value.nil?
    
    printer.text( "#{name}=#{value.pretty_inspect}" )
  end    

  printer.text( ">" )
end