Class: Snov::GetEmailsFromName
- Inherits:
-
Object
- Object
- Snov::GetEmailsFromName
- Defined in:
- lib/snov/get_emails_from_name.rb
Defined Under Namespace
Classes: ProspectData, ProspectEmail, ProspectResult, ProspectStatus
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client: Snov.client, first_name:, last_name:, domain:) ⇒ GetEmailsFromName
constructor
A new instance of GetEmailsFromName.
- #prospect ⇒ Object
- #raw_result ⇒ Object
Constructor Details
#initialize(client: Snov.client, first_name:, last_name:, domain:) ⇒ GetEmailsFromName
Returns a new instance of GetEmailsFromName.
5 6 7 8 9 10 |
# File 'lib/snov/get_emails_from_name.rb', line 5 def initialize(client: Snov.client, first_name:, last_name:, domain:) @client = client @first_name = first_name @last_name = last_name @domain = domain end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/snov/get_emails_from_name.rb', line 3 def client @client end |
Instance Method Details
#prospect ⇒ Object
12 13 14 15 16 |
# File 'lib/snov/get_emails_from_name.rb', line 12 def prospect @prospect ||= ProspectResult.new(raw_result) rescue ArgumentError => e raise ArgumentError.new("#{@raw_result} searching prospect with #{@first_name} #{@last_name} #{@domain}") end |
#raw_result ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/snov/get_emails_from_name.rb', line 18 def raw_result @raw_result ||= client.post("/v1/get-emails-from-names", "firstName" => @first_name, "lastName" => @last_name, "domain" => @domain) .deep_transform_keys! { |key| key.underscore } end |