Class: F1Results::Result
- Inherits:
-
Object
- Object
- F1Results::Result
- Defined in:
- lib/f1results/result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#driver_country_abbr ⇒ Object
Returns the value of attribute driver_country_abbr.
-
#driver_number ⇒ Object
Returns the value of attribute driver_number.
-
#gap ⇒ Object
Returns the value of attribute gap.
-
#laps ⇒ Object
Returns the value of attribute laps.
-
#position ⇒ Object
Returns the value of attribute position.
-
#position_name ⇒ Object
Returns the value of attribute position_name.
-
#team ⇒ Object
Returns the value of attribute team.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(args = {}) ⇒ Result
Returns a new instance of Result.
9 10 11 12 13 14 |
# File 'lib/f1results/result.rb', line 9 def initialize(args = {}) args.each do |k, v| # rescue here in case the results table has an obscure head cell like "Driver's Fastest Time" send("#{k.to_s}=", v) rescue nil end end |
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def driver @driver end |
#driver_country_abbr ⇒ Object
Returns the value of attribute driver_country_abbr.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def driver_country_abbr @driver_country_abbr end |
#driver_number ⇒ Object
Returns the value of attribute driver_number.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def driver_number @driver_number end |
#gap ⇒ Object
Returns the value of attribute gap.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def gap @gap end |
#laps ⇒ Object
Returns the value of attribute laps.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def laps @laps end |
#position ⇒ Object
Returns the value of attribute position.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def position @position end |
#position_name ⇒ Object
Returns the value of attribute position_name.
4 5 6 |
# File 'lib/f1results/result.rb', line 4 def position_name @position_name end |
#team ⇒ Object
Returns the value of attribute team.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def team @team end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/f1results/result.rb', line 3 def time @time end |