Class: SportDb::Parser::MatchLineLegs

Inherits:
Struct
  • Object
show all
Defined in:
lib/sportdb/parser/parse_tree-match.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



21
22
23
# File 'lib/sportdb/parser/parse_tree-match.rb', line 21

def score
  @score
end

#team1Object

Returns the value of attribute team1

Returns:

  • (Object)

    the current value of team1



21
22
23
# File 'lib/sportdb/parser/parse_tree-match.rb', line 21

def team1
  @team1
end

#team2Object

Returns the value of attribute team2

Returns:

  • (Object)

    the current value of team2



21
22
23
# File 'lib/sportdb/parser/parse_tree-match.rb', line 21

def team2
  @team2
end

Instance Method Details

#pretty_print(q) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/sportdb/parser/parse_tree-match.rb', line 23

def pretty_print( q )
  q.group( 4, '<MatchLineLegs ', '>') do        ##  group( indent, open, close)
    q.text( "#{team1} v #{team2}")

    members.zip(values) do |name, value|
      next if [:team1, :team2].include?( name )
      next if value.nil?

      q.breakable
      q.text( "#{name}=" )
      q.pp( value )
    end
  end
end