Class: Tasks::BaseHandler

Inherits:
Object
  • Object
show all
Defined in:
app/models/tasks/base_handler.rb

Overview

While many tasks have handlers included directly in the controller, we are attempting to move them out into independent models. At times these may be more tightly coupled to the controllers than is ideal, reflecting their previous unity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller:, params:, task:, user:) ⇒ BaseHandler

Returns a new instance of BaseHandler.


14
15
16
17
18
19
# File 'app/models/tasks/base_handler.rb', line 14

def initialize(controller:, params:, task:, user:)
  @controller = controller
  @params = params
  @task = task
  @user = user
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.


10
11
12
# File 'app/models/tasks/base_handler.rb', line 10

def controller
  @controller
end

#paramsObject (readonly)

Returns the value of attribute params.


10
11
12
# File 'app/models/tasks/base_handler.rb', line 10

def params
  @params
end

#taskObject (readonly)

Returns the value of attribute task.


10
11
12
# File 'app/models/tasks/base_handler.rb', line 10

def task
  @task
end

#userObject (readonly)

Returns the value of attribute user.


10
11
12
# File 'app/models/tasks/base_handler.rb', line 10

def user
  @user
end