No description, website, or topics provided.
Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
spec
.gitignore
.rspec
.ruby-gemset
.travis.yml
CONTRIBUTING.md
Gemfile
Gemfile.devtools
Guardfile
LICENSE
README.md
Rakefile
TODO
abstract_type.gemspec

README.md

abstract_type

This is a small standalone gem featuring a module ripped out from axiom. It allows to declare abstract_type classes and modules in an unobstrusive way.

Gem Version Build Status Dependency Status Code Climate Coverage Status

Examples

class Foo
  include AbstractType

  # Declare abstract instance method
  abstract_method :bar

  # Declare abstract singleton method
  abstract_singleton_method :baz
end

Foo.new  # raises NotImplementedError: Foo is an abstract type
Foo.baz  # raises NotImplementedError: Foo.baz is not implemented

# Subclassing to allow instantiation
class Baz < Foo; end

object = Baz.new
object.bar  # raises NotImplementedError: Baz#bar is not implemented

Credits

Contributing

See CONTRIBUTING.md for details.

Copyright

Copyright © 2009-2013 Dan Kubb. See LICENSE for details.