Sha256: 2b26435ca7433b7cf65a59d86a599c693b8bc714554fdd9c6b379691145d5b72
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
module FbGraph class Work include FbGraph::Comparison attr_accessor :employer, :location, :position, :start_date, :end_date def initialize(attributes = {}) if (employer = attributes[:employer]) @employer = FbGraph::Page.new(employer.delete(:id), employer) end if (location = attributes[:location]) @location = FbGraph::Page.new(location.delete(:id), location) end if (position = attributes[:position]) @position = FbGraph::Page.new(position.delete(:id), position) end if attributes[:start_date] && attributes[:start_date] != '0000-00' year, month = attributes[:start_date].split('-').collect(&:to_i) @start_date = if month == 0 Date.new(year) else Date.new(year, month) end end if attributes[:end_date] && attributes[:end_date] != '0000-00' year, month = attributes[:end_date].split('-').collect(&:to_i) @end_date = if month == 0 Date.new(year) else Date.new(year, month) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems