Module: Course::Assessment::Submission::SubmissionsControllerServiceConcern::ClassMethods

Defined in:
app/controllers/concerns/course/assessment/submission/submissions_controller_service_concern.rb

Instance Method Summary collapse

Instance Method Details

#delegate_to_service(action) ⇒ Object

Delegate the action to the service and extract the instance variables from the service after the action is done.


36
37
38
39
40
41
# File 'app/controllers/concerns/course/assessment/submission/submissions_controller_service_concern.rb', line 36

def delegate_to_service(action)
  define_method(action) do
    service.public_send(action)
    extract_instance_variables(service)
  end
end