Sha256: a16a1f269a9b9e890d1f6ce270b9772ebdf986c0eae649abcfb0c7266ef3f827
Contents?: true
Size: 902 Bytes
Versions: 7
Compression:
Stored size: 902 Bytes
Contents
module LinkedIn class Education < LinkedIn::Base def educations @educations ||= @doc.children.inject([]) do |list, edu| list << Resource.new(edu) unless edu.blank? list end end class Resource def initialize(education) @education = education end %w[id school_name degree field_of_study activities notes].each do |f| define_method(f.to_sym) do @education.xpath("./#{f.gsub(/_/,'-')}").text end end def start_month @education.xpath('./start-date/month').text.to_i end def start_year @education.xpath('./start-date/year').text.to_i end def end_month @education.xpath('./end-date/month').text.to_i end def end_year @education.xpath('./end-date/year').text.to_i end end # resource class end # education class end
Version data entries
7 entries across 7 versions & 3 rubygems