Class: Interface::Adapter
- Inherits:
-
Object
- Object
- Interface::Adapter
- Extended by:
- FactoryMethods
- Defined in:
- lib/interface/adapter.rb
Constant Summary collapse
- CallingError =
Class.new(StandardError)
- InterfaceError =
Class.new(StandardError)
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(callable) ⇒ Adapter
constructor
A new instance of Adapter.
Constructor Details
#initialize(callable) ⇒ Adapter
Returns a new instance of Adapter.
10 11 12 |
# File 'lib/interface/adapter.rb', line 10 def initialize(callable) @callable = callable end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/interface/adapter.rb', line 14 def call unless callable.respond_to?(:call) fail(InterfaceError("#{callable.class} is not callable!")) end _call end |