Class: PlainService::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/plain_service/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.perform(params) ⇒ Object



9
10
11
# File 'lib/plain_service/base.rb', line 9

def self.perform(params)
  new(params).perform
end

Instance Method Details

#performObject



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

def perform
  if valid?
    process
  else
    false
  end
end

#processObject

Should return whether true or false value depending on success/fail status of service object actions



22
23
24
# File 'lib/plain_service/base.rb', line 22

def process
  raise NotImplementedError('You should implement #process method in your child class')
end