Class: Orcid::Remote::Service
- Inherits:
-
Object
- Object
- Orcid::Remote::Service
- Defined in:
- app/services/orcid/remote/service.rb
Overview
An abstract service class, responsible for making remote calls and issuing a callback.
Direct Known Subclasses
Instance Method Summary collapse
- #call ⇒ Object
- #callback(name, *args) ⇒ Object
-
#initialize {|@callbacks| ... } ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize {|@callbacks| ... } ⇒ Service
Returns a new instance of Service.
7 8 9 10 |
# File 'app/services/orcid/remote/service.rb', line 7 def initialize @callbacks = Orcid::NamedCallbacks.new yield(@callbacks) if block_given? end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'app/services/orcid/remote/service.rb', line 12 def call fail NotImplementedError, ("Define #{self.class}#call") end |
#callback(name, *args) ⇒ Object
16 17 18 19 |
# File 'app/services/orcid/remote/service.rb', line 16 def callback(name, *args) @callbacks.call(name, *args) args end |