Module: TypeToolkit::Interface
- Defined in:
- lib/type_toolkit/interface.rb
Overview
This module is extended onto any module that represents an interface. All of its members should be public and abstract.
Instance Method Summary collapse
Instance Method Details
#included(target_module) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/type_toolkit/interface.rb', line 28 def included(target_module) # Including/extending a module is idempotent, so we don't have to worry these were already included/extended. # Potentially abstract methods will be called on instances of `self`, so we need the `method_missing` hooks. target_module.include(TypeToolkit::AbstractInstanceMethodReceiver) # The `method_missing` hooks need to be able to look up the abstract methods (from the interface). target_module.extend(TypeToolkit::HasAbstractMethods) end |