Skip to content

Commit cd9d111

Browse files
committed
refactored timer exercise
1 parent fc1a670 commit cd9d111

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

09_timer/timer.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
class Timer
2-
def initialize
3-
@seconds = 0
4-
end
2+
attr_accessor :seconds
53

6-
def seconds
4+
def initialize
75
@seconds = 0
86
end
97

10-
def seconds=(time)
11-
@seconds = time
12-
end
13-
148
def time_string
159
hr = (@seconds / 3600).to_s
1610
min = ((@seconds / 60) % 60).to_s

10_temperature_object/temperature.rb

Whitespace-only changes.

0 commit comments

Comments
 (0)