Class: Cufinder::Client
- Inherits:
-
Object
- Object
- Cufinder::Client
- Defined in:
- lib/cufinder_ruby/client.rb
Overview
Main client class for interacting with the CUFinder API
This is the primary entry point for all API operations. It provides convenient methods for each service and handles authentication and HTTP communication internally.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
Instance Method Summary collapse
- #bcd(url:) ⇒ Object
- #caa(query:, page:) ⇒ Object
- #car(query:) ⇒ Object
- #cbc(url:) ⇒ Object
- #ccp(url:) ⇒ Object
- #cec(query:) ⇒ Object
- #cef(query:, page:) ⇒ Object
- #cja(**params) ⇒ Object
- #clo(query:) ⇒ Object
- #csc(url:) ⇒ Object
- #cse(**params) ⇒ Object
- #csn(url:) ⇒ Object
-
#cuf(company_name:, country_code:) ⇒ Object
Service methods - Each method corresponds to a CUFinder API service.
- #dtc(company_website:) ⇒ Object
- #dte(company_website:) ⇒ Object
- #elf(query:) ⇒ Object
- #enc(query:) ⇒ Object
- #epp(linkedin_url:) ⇒ Object
- #fcc(query:) ⇒ Object
- #fcl(query:) ⇒ Object
- #fts(query:) ⇒ Object
- #fwe(linkedin_url:) ⇒ Object
-
#initialize(api_key:, timeout: 30, max_retries: 3) ⇒ Client
constructor
Initialize a new CUFinder client.
- #isc(url:) ⇒ Object
- #lbs(**params) ⇒ Object
- #lcuf(company_name:) ⇒ Object
- #naa(address:) ⇒ Object
- #nac(company:) ⇒ Object
- #nao(phone:) ⇒ Object
- #ntp(company_name:) ⇒ Object
- #pse(**params) ⇒ Object
- #rel(email:) ⇒ Object
- #tep(full_name:, company:) ⇒ Object
Constructor Details
#initialize(api_key:, timeout: 30, max_retries: 3) ⇒ Client
Initialize a new CUFinder client
23 24 25 26 27 28 29 30 |
# File 'lib/cufinder_ruby/client.rb', line 23 def initialize(api_key:, timeout: 30, max_retries: 3) @client = BaseApiClient.new( api_key: api_key, timeout: timeout, max_retries: max_retries ) @services = Services.new(@client) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
16 17 18 |
# File 'lib/cufinder_ruby/client.rb', line 16 def client @client end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
16 17 18 |
# File 'lib/cufinder_ruby/client.rb', line 16 def services @services end |
Instance Method Details
#bcd(url:) ⇒ Object
113 114 115 |
# File 'lib/cufinder_ruby/client.rb', line 113 def bcd(url:) @services.extract_b2b_customers(url: url) end |
#caa(query:, page:) ⇒ Object
153 154 155 |
# File 'lib/cufinder_ruby/client.rb', line 153 def caa(query:, page:) @services.get_company_activities(query: query, page: page) end |
#car(query:) ⇒ Object
65 66 67 |
# File 'lib/cufinder_ruby/client.rb', line 65 def car(query:) @services.get_annual_revenue(query: query) end |
#cbc(url:) ⇒ Object
125 126 127 |
# File 'lib/cufinder_ruby/client.rb', line 125 def cbc(url:) @services.get_company_business_type(url: url) end |
#ccp(url:) ⇒ Object
117 118 119 |
# File 'lib/cufinder_ruby/client.rb', line 117 def ccp(url:) @services.find_company_careers_page(url: url) end |
#cec(query:) ⇒ Object
93 94 95 |
# File 'lib/cufinder_ruby/client.rb', line 93 def cec(query:) @services.get_company_employee_count(query: query) end |
#cef(query:, page:) ⇒ Object
145 146 147 |
# File 'lib/cufinder_ruby/client.rb', line 145 def cef(query:, page:) @services.find_company_employees(query: query, page: page) end |
#cja(**params) ⇒ Object
157 158 159 |
# File 'lib/cufinder_ruby/client.rb', line 157 def cja(**params) @services.search_company_jobs(params) end |
#clo(query:) ⇒ Object
97 98 99 |
# File 'lib/cufinder_ruby/client.rb', line 97 def clo(query:) @services.get_company_locations(query: query) end |
#csc(url:) ⇒ Object
129 130 131 |
# File 'lib/cufinder_ruby/client.rb', line 129 def csc(url:) @services.get_company_mission_statement(url: url) end |
#cse(**params) ⇒ Object
101 102 103 |
# File 'lib/cufinder_ruby/client.rb', line 101 def cse(**params) @services.search_companies(params) end |
#csn(url:) ⇒ Object
133 134 135 |
# File 'lib/cufinder_ruby/client.rb', line 133 def csn(url:) @services.get_company_snapshot(url: url) end |
#cuf(company_name:, country_code:) ⇒ Object
Service methods - Each method corresponds to a CUFinder API service
33 34 35 |
# File 'lib/cufinder_ruby/client.rb', line 33 def cuf(company_name:, country_code:) @services.get_domain(company_name: company_name, country_code: country_code) end |
#dtc(company_website:) ⇒ Object
41 42 43 |
# File 'lib/cufinder_ruby/client.rb', line 41 def dtc(company_website:) @services.get_company_name(company_website: company_website) end |
#dte(company_website:) ⇒ Object
45 46 47 |
# File 'lib/cufinder_ruby/client.rb', line 45 def dte(company_website:) @services.get_emails(company_website: company_website) end |
#elf(query:) ⇒ Object
61 62 63 |
# File 'lib/cufinder_ruby/client.rb', line 61 def elf(query:) @services.enrich_linkedin_fundraising(query: query) end |
#enc(query:) ⇒ Object
89 90 91 |
# File 'lib/cufinder_ruby/client.rb', line 89 def enc(query:) @services.enrich_company(query: query) end |
#epp(linkedin_url:) ⇒ Object
77 78 79 |
# File 'lib/cufinder_ruby/client.rb', line 77 def epp(linkedin_url:) @services.enrich_person_profile(linkedin_url: linkedin_url) end |
#fcc(query:) ⇒ Object
69 70 71 |
# File 'lib/cufinder_ruby/client.rb', line 69 def fcc(query:) @services.find_company_children(query: query) end |
#fcl(query:) ⇒ Object
57 58 59 |
# File 'lib/cufinder_ruby/client.rb', line 57 def fcl(query:) @services.find_company_lookalikes(query: query) end |
#fts(query:) ⇒ Object
73 74 75 |
# File 'lib/cufinder_ruby/client.rb', line 73 def fts(query:) @services.find_tech_stack(query: query) end |
#fwe(linkedin_url:) ⇒ Object
81 82 83 |
# File 'lib/cufinder_ruby/client.rb', line 81 def fwe(linkedin_url:) @services.find_work_email(linkedin_url: linkedin_url) end |
#isc(url:) ⇒ Object
121 122 123 |
# File 'lib/cufinder_ruby/client.rb', line 121 def isc(url:) @services.is_saas(url: url) end |
#lbs(**params) ⇒ Object
109 110 111 |
# File 'lib/cufinder_ruby/client.rb', line 109 def lbs(**params) @services.search_local_businesses(params) end |
#lcuf(company_name:) ⇒ Object
37 38 39 |
# File 'lib/cufinder_ruby/client.rb', line 37 def lcuf(company_name:) @services.get_linkedin_url(company_name: company_name) end |
#naa(address:) ⇒ Object
141 142 143 |
# File 'lib/cufinder_ruby/client.rb', line 141 def naa(address:) @services.normalize_address(address: address) end |
#nac(company:) ⇒ Object
149 150 151 |
# File 'lib/cufinder_ruby/client.rb', line 149 def nac(company:) @services.normalize_company_name(company: company) end |
#nao(phone:) ⇒ Object
137 138 139 |
# File 'lib/cufinder_ruby/client.rb', line 137 def nao(phone:) @services.normalize_phone(phone: phone) end |
#ntp(company_name:) ⇒ Object
49 50 51 |
# File 'lib/cufinder_ruby/client.rb', line 49 def ntp(company_name:) @services.get_phones(company_name: company_name) end |
#pse(**params) ⇒ Object
105 106 107 |
# File 'lib/cufinder_ruby/client.rb', line 105 def pse(**params) @services.search_people(params) end |
#rel(email:) ⇒ Object
53 54 55 |
# File 'lib/cufinder_ruby/client.rb', line 53 def rel(email:) @services.get_person_by_email(email: email) end |
#tep(full_name:, company:) ⇒ Object
85 86 87 |
# File 'lib/cufinder_ruby/client.rb', line 85 def tep(full_name:, company:) @services.get_title_email_phone(full_name: full_name, company: company) end |