Skip to content

Instantly share code, notes, and snippets.

@umasenthil
Created November 6, 2015 00:02
Show Gist options
  • Save umasenthil/8b2322e3ad47da390866 to your computer and use it in GitHub Desktop.
Save umasenthil/8b2322e3ad47da390866 to your computer and use it in GitHub Desktop.
class Clock
attr_accessor :hour, :mins, :secs
def initialize(hour, mins, secs)
self.hour = hour
self.mins = mins
self.secs = secs
end
def show_time
puts "User input hour : #{@hour} minutes :#{@mins} seconds : #{@secs}"
end
end
myClock = Clock.new(10, 05, 30)
myClock.show_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment