Skip to content

Instantly share code, notes, and snippets.

@hollanddd
Created April 22, 2013 19:34
Show Gist options
  • Save hollanddd/5437821 to your computer and use it in GitHub Desktop.
Save hollanddd/5437821 to your computer and use it in GitHub Desktop.
class Bird
class << self
attr_accessor :instances
end
self.instances = []
def initialize name
@name = name
@flying = false
self.class.instances << self
end
def fly
@flying = true
end
def flying?
@flying
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment