Method: Timerizer::WallClock.from_string
- Defined in:
- lib/timerizer/wall_clock.rb
.from_string(string) ⇒ WallClock
Takes a string and turns it into a WallClock time
76 77 78 79 80 |
# File 'lib/timerizer/wall_clock.rb', line 76 def self.from_string(string) time, meridiem = string.split(' ', 2) hour, minute, second = time.split(':', 3) WallClock.new(hour.to_i, minute.to_i, second.to_i || 0, meridiem || :am) end |