Skip to content

Instantly share code, notes, and snippets.

@oelmekki
Created May 19, 2012 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oelmekki/2730522 to your computer and use it in GitHub Desktop.
Save oelmekki/2730522 to your computer and use it in GitHub Desktop.
kik goes out
#!/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