Sha256: 8ea868220cbfd193f8bafc9d1da3be9f4e39af3aa5af2ac2bd437ebbf82771cf
Contents?: true
Size: 387 Bytes
Versions: 7
Compression:
Stored size: 387 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
7 entries across 7 versions & 2 rubygems