Class: RailsExecution::Tasks::CreateService

Inherits:
Object
  • Object
show all
Defined in:
app/services/rails_execution/tasks/create_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, current_owner) ⇒ CreateService

Returns a new instance of CreateService.



3
4
5
6
7
8
# File 'app/services/rails_execution/tasks/create_service.rb', line 3

def initialize(params, current_owner)
  @params = params
  @current_owner = current_owner
  @task = nil
  @error = nil
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



19
20
21
# File 'app/services/rails_execution/tasks/create_service.rb', line 19

def error
  @error
end

#taskObject (readonly)

Returns the value of attribute task.



20
21
22
# File 'app/services/rails_execution/tasks/create_service.rb', line 20

def task
  @task
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'app/services/rails_execution/tasks/create_service.rb', line 10

def call
  initialize_task
  create_task
rescue => e
  @error = e.to_s
ensure
  return self
end