Class: RaccMatchParser::MatchLine

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date

Returns:

  • (Object)

    the current value of date



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def date
  @date
end

#geoObject

Returns the value of attribute geo

Returns:

  • (Object)

    the current value of geo



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def geo
  @geo
end

#ordObject

Returns the value of attribute ord

Returns:

  • (Object)

    the current value of ord



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def ord
  @ord
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def score
  @score
end

#team1Object

Returns the value of attribute team1

Returns:

  • (Object)

    the current value of team1



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def team1
  @team1
end

#team2Object

Returns the value of attribute team2

Returns:

  • (Object)

    the current value of team2



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def team2
  @team2
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



185
186
187
# File 'lib/sportdb/parser.rb', line 185

def time
  @time
end

Instance Method Details

#pretty_print(printer) ⇒ Object



189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/sportdb/parser.rb', line 189

def pretty_print( printer )
  printer.text( "<MatchLine " )
  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