0.65
No commit activity in last 3 years
No release in over 3 years
Module to declare abstract classes and methods
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3.5, ~> 1.3
 Project Readme

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.