Created
May 19, 2012 11:29
-
-
Save oelmekki/2730522 to your computer and use it in GitHub Desktop.
kik goes out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Person | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
@go_out = 0 | |
end | |
protected | |
def go_out | |
@max_go_out = 5 | |
@go_out += 1 | |
if @go_out == @max_go_out | |
@go_out = 0 | |
puts "#{@name} met de la creme solaire et peut de nouveau sortir !" | |
end | |
end | |
end | |
kik = Person.new('kik') | |
10.times { kik.go_out } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment