Sha256: 30903c5983812fe6666daeeb9ddca334d562157b5bd9782a2c5304dc6da631aa
Contents?: true
Size: 1.03 KB
Versions: 5
Compression:
Stored size: 1.03 KB
Contents
module LinkedIn ADDRESS_FIELDS = [ 'street1', 'street2', 'city', 'state', 'postal-code', 'country-code', 'region-code' ] CONTACT_INFO_FIELDS = [ 'phone1', 'phone2', 'fax' ] COMPANY_LOCATIONS_FIELDS = ['description', 'is-headquarters', 'is-active', { 'address' => ADDRESS_FIELDS }, { 'contact-info' => CONTACT_INFO_FIELDS } ] COMPANY_BASE_FIELDS = [ 'id', 'name', 'universal-name', 'email-domains', 'company-type', 'ticker', 'website-url', 'industries', 'status', 'logo-url', 'square-logo-url', 'blog-rss-url', 'twitter-id', 'employee-count-range', 'specialties', { 'locations' => COMPANY_LOCATIONS_FIELDS }, 'description', 'stock-exchange', 'founded-year', 'end-year', 'num-followers' ] class Company < Base def self.find(id, *fields) find_by( { id: id }, *fields) end def self.find_by(selector, *fields) fields = fields.blank? ? COMPANY_BASE_FIELDS : fields Company.new client.company( selector: selector, fields: fields ) end end end
Version data entries
5 entries across 5 versions & 1 rubygems