Class: FetchUpdatedParallels

Inherits:
Object
  • Object
show all
Includes:
Interpipe::Interactor
Defined in:
app/interactors/fetch_updated_parallels.rb

Instance Method Summary collapse

Methods included from Interpipe::Interactor

included, #initialize

Instance Method Details

#perform(faculty_semester: nil, page_size: 100, fetch_all: true) ⇒ Object


11
12
13
14
15
# File 'app/interactors/fetch_updated_parallels.rb', line 11

def perform(faculty_semester: nil, page_size: 100, fetch_all: true)
  updated_parallels = @finder.find_updated(faculty: faculty_semester.faculty, semester: faculty_semester.code, page_size: page_size)
  updated_parallels.auto_paginate = fetch_all
  @results = {kosapi_parallels: updated_parallels, faculty_semester: faculty_semester }
end

#setup(finder: Sirius::UpdatedParallelsFinder.new) ⇒ Object


7
8
9
# File 'app/interactors/fetch_updated_parallels.rb', line 7

def setup(finder: Sirius::UpdatedParallelsFinder.new)
  @finder = finder
end