Class: Snov::GetEmailsBySocialUrl

Inherits:
Object
  • Object
show all
Defined in:
lib/snov/get_emails_by_social_url.rb

Defined Under Namespace

Classes: ProspectData, ProspectEmail, ProspectJob, ProspectJobList, ProspectResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: Snov.client, url:) ⇒ GetEmailsBySocialUrl

Returns a new instance of GetEmailsBySocialUrl.



5
6
7
8
# File 'lib/snov/get_emails_by_social_url.rb', line 5

def initialize(client: Snov.client, url:)
  @client = client
  @url = url
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/snov/get_emails_by_social_url.rb', line 3

def client
  @client
end

Instance Method Details

#prospectObject



10
11
12
# File 'lib/snov/get_emails_by_social_url.rb', line 10

def prospect
  @prospect ||= ProspectResult.new(raw_result)
end

#raw_resultObject



14
15
16
17
# File 'lib/snov/get_emails_by_social_url.rb', line 14

def raw_result
  @raw_result ||= client.post("/v1/get-emails-from-url", "url" => @url)
                        .deep_transform_keys! { |key| key.underscore }
end