Sha256: 0b7ac4a904c0dd3d1e4b809b433781f8d167abe43e6645cfd0af638a2a945dc3
Contents?: true
Size: 930 Bytes
Versions: 5
Compression:
Stored size: 930 Bytes
Contents
module LinkedIn class Education < LinkedIn::Base def education @array ||= begin @array = [] @doc.children.each do |edu| @array << Resource.new(edu) unless edu.blank? end @array end end class Resource def initialize(education) @education = education end %w[id school_name degree field_of_study activities].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
5 entries across 5 versions & 1 rubygems