Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created September 1, 2010 15:09
Show Gist options
  • Select an option

  • Save workmad3/560822 to your computer and use it in GitHub Desktop.

Select an option

Save workmad3/560822 to your computer and use it in GitHub Desktop.
class Abstract
class << self
private :new
end
def self.inherited(klass)
class << klass
public :new
end
end
end
class Concrete < Abstract
end
Abstract.new #=> NoMethodError
Concrete.new #=> Works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment