Module: ParseProfile
- Included in:
- LinkedinData
- Defined in:
- lib/parse_profile.rb
Instance Method Summary collapse
-
#addPersonFields(c, status, profile) ⇒ Object
Merge person data with role data.
-
#deleteDuplicatePics ⇒ Object
Deletes duplicate pictures.
-
#parseResume(profile) ⇒ Object
Parse profile into items by company.
Instance Method Details
#addPersonFields(c, status, profile) ⇒ Object
Merge person data with role data
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/parse_profile.rb', line 28 def addPersonFields(c, status, profile) c.merge!( skills: profile.skills, certifications: profile.certifications, languages: profile.languages, name: profile.name, location: profile.location, area: profile.country, industry: profile.industry, picture: profile.picture, organizations: profile.organizations, groups: profile.groups, education: profile.education, websites: profile.websites, profile_url: profile.profile_url, summary: profile.summary, current: status, timestamp: profile., related_people: profile., degree: profile.degree, pic_path: profile.pic_path) return c end |
#deleteDuplicatePics ⇒ Object
Deletes duplicate pictures
20 21 22 23 24 25 |
# File 'lib/parse_profile.rb', line 20 def deleteDuplicatePics pics = Dir["public/uploads/pictures/*.jpg.*"] pics.each do |p| File.delete(p) end end |
#parseResume(profile) ⇒ Object
Parse profile into items by company
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/parse_profile.rb', line 3 def parseResume(profile) output = Array.new # Parse profiles for current companies profile.current_companies.each do |c| output.push(addPersonFields(c, "Yes", profile)) end # Parse past position/company info profile.past_companies.each do |c| output.push(addPersonFields(c, "No", profile)) end return output end |