Sha256: b9663c62936f1b3691c2d1d0c223b50beb004c91bffa450e12ac0d4580cc9894
Contents?: true
Size: 966 Bytes
Versions: 7
Compression:
Stored size: 966 Bytes
Contents
module LinkedIn class Position < LinkedIn::Base def positions @positions ||= @doc.children.inject([]) do |list, position| list << Resource.new(position) unless position.blank? list end end class Resource def initialize(position) @position = position end %w[id title summary is_current].each do |f| define_method(f.to_sym) do @position.xpath("./#{f.gsub(/_/,'-')}").text end end def start_month @position.xpath('./start-date/month').text.to_i end def start_year @position.xpath('./start-date/year').text.to_i end def end_month @position.xpath('./end-date/month').text.to_i end def end_year @position.xpath('./end-date/year').text.to_i end def company @company ||= Company.new(@position.xpath('./company')) end end # resource end # class end # module
Version data entries
7 entries across 7 versions & 3 rubygems