Sha256: 769f2bd88cc9392bda1831434dd3aeab163047c8f4cf431a091ddeca7374c6c4
Contents?: true
Size: 386 Bytes
Versions: 10
Compression:
Stored size: 386 Bytes
Contents
class Module # Create an abstract method. If it is not overridden, it will # raise a TypeError when called. # # class C # abstract :a # end # # c = C.new # c.a #=> Error: undefined abstraction #a # # CREDIT: Trans def abstract( *sym ) sym.each { |s| define_method( s ) { raise TypeError, "undefined abstraction ##{s}" } } end end
Version data entries
10 entries across 10 versions & 1 rubygems