Class: Orcid::Remote::Service

Inherits:
Object
  • Object
show all
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

ProfileCreationService, ProfileQueryService

Instance Method Summary collapse

Constructor Details

#initialize {|@callbacks| ... } ⇒ Service

Returns a new instance of Service.

Yields:

  • (@callbacks)


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

#callObject



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