Skip to content

Instantly share code, notes, and snippets.

@gavinheavyside
Created February 19, 2014 11:30
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 gavinheavyside/9090270 to your computer and use it in GitHub Desktop.
Save gavinheavyside/9090270 to your computer and use it in GitHub Desktop.
class Crap
attr_accessor :crappiness
def initialize(tolerability = 5)
@crappiness = 0
@tolerability = tolerability
end
def +(int)
result = dup
result.crappiness += int
return result
end
def intolerable?
@crappiness >= @tolerability
end
end
crap = Crap.new
puts crap.intolerable?
crap += 5
puts crap.intolerable?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment