lib/fullcontact/client/company.rb in fullcontact-0.17.0 vs lib/fullcontact/client/company.rb in fullcontact-0.18.0
- old
+ new
@@ -1,12 +1,16 @@
module FullContact
class Client
module Company
- # Returns extended information for a given person (email, phone, twitter or facebook)
+ # Returns extended information for a given company (email, phone, twitter or facebook)
#
def company(options={}, faraday_options={})
- response = get('company/lookup', options, false, faraday_options)
- format.to_s.downcase == 'xml' ? response['person'] : response
+ url = "company/lookup"
+ if options[:companyName]
+ url = "company/search"
+ end
+ response = get(url, options, false, faraday_options)
+ format.to_s.downcase == 'xml' ? response['response'] : response
end
end
end
end