Class: ApplicationService

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
ActiveModel::Model
Defined in:
app/services/application_service.rb

Overview

All services should be inherited from this service and implement `#perform` method. `#perform` should be the only one public method in service (one action = one service = one public method). Service name should be action without “service” word.

Examples:

class Portfolio::Create < ApplicationService
  # ...
end

Direct Known Subclasses

Moex::SyncDictionariesService

Class Method Summary collapse

Class Method Details

.perform(*args) ⇒ Object

If a service object doesn't needed this class method can be used.

Parameters:

  • args (Hash)

    arguments for `Service.new`


20
21
22
# File 'app/services/application_service.rb', line 20

def self.perform(*args)
  new(*args).perform
end