Class: ConvertPeople

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

Instance Method Summary collapse

Methods included from Interpipe::Interactor

included, #initialize, #setup

Instance Method Details

#convert_person(person_link) ⇒ Object


15
16
17
18
# File 'app/interactors/convert_people.rb', line 15

def convert_person(person_link)
  username = person_link.link_id
  Person.new(full_name: person_link.link_title) { |p| p.id = username }
end

#perform(kosapi_people:, **opts) ⇒ Object


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

def perform(kosapi_people:, **opts)
 @people = kosapi_people.map { |person| convert_person(person) }
end

#resultsObject


11
12
13
# File 'app/interactors/convert_people.rb', line 11

def results
  { people: @people }
end