Class: Substation::Observer Abstract
- Inherits:
-
Object
- Object
- Substation::Observer
- Includes:
- AbstractType, Adamantium::Flat
- Defined in:
- lib/substation/observer.rb
Overview
This class is abstract.
Abstract observer base class
Direct Known Subclasses
Defined Under Namespace
Classes: Chain
Constant Summary collapse
- NULL =
Null observer
Class.new(self) { def call(_response); self; end; }.new.freeze
Class Method Summary collapse
-
.coerce(input) ⇒ Observer::NULL, ...
private
Coerce
input
to an instance of Observer.
Instance Method Summary collapse
-
#call ⇒ self
private
Notify the observer.
Class Method Details
.coerce(input) ⇒ Observer::NULL, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Coerce input
to an instance of Substation::Observer
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/substation/observer.rb', line 30 def self.coerce(input) case input when NilClass NULL when Array Chain.new(input.map { |item| coerce(item) }) else Utils.coerce_callable(input) end end |
Instance Method Details
#call ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Notify the observer
19 |
# File 'lib/substation/observer.rb', line 19 abstract_method :call |