Skip to content

Instantly share code, notes, and snippets.

@johnbender
Created February 21, 2009 19:53
Show Gist options
  • Save johnbender/68163 to your computer and use it in GitHub Desktop.
Save johnbender/68163 to your computer and use it in GitHub Desktop.
class MailTruck
@@trucks = []
def MailTruck.add( truck )
@@trucks << truck
end
def say_hi
puts "Hi, I'm one of #{@@trucks.length} trucks!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment