Class: AhlScraper::IceTimeHelper
- Inherits:
-
Object
- Object
- AhlScraper::IceTimeHelper
- Defined in:
- lib/ahl_scraper/helpers/ice_time_helper.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time) ⇒ IceTimeHelper
constructor
A new instance of IceTimeHelper.
- #to_seconds ⇒ Object (also: #to_sec)
Constructor Details
#initialize(time) ⇒ IceTimeHelper
Returns a new instance of IceTimeHelper.
7 8 9 |
# File 'lib/ahl_scraper/helpers/ice_time_helper.rb', line 7 def initialize(time) @time = time end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/ahl_scraper/helpers/ice_time_helper.rb', line 5 def time @time end |
Instance Method Details
#to_seconds ⇒ Object Also known as: to_sec
11 12 13 14 15 16 |
# File 'lib/ahl_scraper/helpers/ice_time_helper.rb', line 11 def to_seconds return unless time ice_time = time&.split(":") ice_time[0].to_i * 60 + ice_time[1].to_i end |