Class: RunnersUpdate::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/runners_update/runner.rb

Overview

ランナークラス

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number, name) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
9
# File 'lib/runners_update/runner.rb', line 5

def initialize(number, name)
  @number = number
  @name = name
  @splits = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/runners_update/runner.rb', line 4

def name
  @name
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/runners_update/runner.rb', line 4

def number
  @number
end

#splitsObject

Returns the value of attribute splits.



4
5
6
# File 'lib/runners_update/runner.rb', line 4

def splits
  @splits
end

Instance Method Details

#add_point(name, split, lap, pass) ⇒ Object

ポイントの追加

Parameters:

  • name (String)

    測定ポイント名

  • split (String)

    スプリットタイム

  • lap (String)

    ラップタイム

  • pass (String)

    通過タイム



17
18
19
# File 'lib/runners_update/runner.rb', line 17

def add_point(name, split, lap, pass)
  @splits << Point.new(name, split, lap, pass)
end