Class: Services::Base

Inherits:
Object
  • Object
show all
Includes:
ObjectClass
Defined in:
lib/services/base.rb,
lib/services/modules/call_logger.rb,
lib/services/modules/exception_wrapper.rb,
lib/services/modules/uniqueness_checker.rb

Defined Under Namespace

Modules: CallLogger, ExceptionWrapper, UniquenessChecker

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



24
25
26
# File 'lib/services/base.rb', line 24

def initialize
  @id = SecureRandom.hex(6)
end

Class Method Details

.inherited(subclass) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/services/base.rb', line 11

def inherited(subclass)
  subclass.const_set :Error, Class.new(StandardError)
  subclass.public_send :include, Rails.application.routes.url_helpers if defined?(Rails)
  begin
    subclass.public_send :include, Asyncable
  rescue Services::NoBackgroundProcessorFound
  end
  subclass.public_send :prepend, CallLogger, ExceptionWrapper, UniquenessChecker
end

Instance Method Details

#call(*args, **kwargs) ⇒ Object

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/services/base.rb', line 28

def call(*args, **kwargs)
  raise NotImplementedError
end