Class: F1Results::RaceResult

Inherits:
Result
  • Object
show all
Defined in:
lib/f1results/result.rb

Instance Attribute Summary collapse

Attributes inherited from Result

#driver, #driver_country_abbr, #driver_number, #gap, #laps, #position, #position_name, #team, #time

Instance Method Summary collapse

Methods inherited from Result

#initialize

Constructor Details

This class inherits a constructor from F1Results::Result

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



68
69
70
# File 'lib/f1results/result.rb', line 68

def points
  @points
end

#retiredObject

Returns the value of attribute retired.



68
69
70
# File 'lib/f1results/result.rb', line 68

def retired
  @retired
end

Instance Method Details

#time_or_retiredObject



85
86
87
# File 'lib/f1results/result.rb', line 85

def time_or_retired
  time || retired
end

#time_or_retired=(str) ⇒ Object Also known as: time_retired=



76
77
78
79
80
81
82
# File 'lib/f1results/result.rb', line 76

def time_or_retired=(str)
  if /^[0-9]|\+/ =~ str
    @time = str
  else
    @retired = str
  end
end

#to_aObject



72
73
74
# File 'lib/f1results/result.rb', line 72

def to_a
  [position_name, driver_number, driver, team, laps, time_or_retired, points]
end