Skip to content

Instantly share code, notes, and snippets.

@joshuajhun
Created April 27, 2016 16:06
Show Gist options
  • Save joshuajhun/b0409c68fbbc9e830fd41640b5cbc40c to your computer and use it in GitHub Desktop.
Save joshuajhun/b0409c68fbbc9e830fd41640b5cbc40c to your computer and use it in GitHub Desktop.
class Pokemon
attr_reader :yung_name
def initialize(name)
@yung_name = name
end
def sleeping(time)
sleep(time)
"#{yung_name} fell asleep for #{time} seconds!"
end
end
snorlax = Pokemon.new('snorlax')
snorlax.sleep(5)
#=> "snorlax fell asleep for 5 seconds!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment