class Snov::GetProfileByEmail

Attributes

client[R]
email[R]

Public Class Methods

new(email:, client: Snov.client) click to toggle source
# File lib/snov/get_profile_by_email.rb, line 7
def initialize(email:, client: Snov.client)
  @client = client
  @email = email.to_str
end

Public Instance Methods

each(&block) click to toggle source
# File lib/snov/get_profile_by_email.rb, line 12
def each(&block)
  prospects.each(&block)
end
method_missing(method_name, *arguments, &block) click to toggle source
Calls superclass method
# File lib/snov/get_profile_by_email.rb, line 20
def method_missing(method_name, *arguments, &block)
  if prospect.respond_to?(method_name)
    prospect.public_send(method_name, *arguments, &block)
  else
    super
  end
end
prospect() click to toggle source
# File lib/snov/get_profile_by_email.rb, line 16
def prospect
  @prospect ||= ProspectResult.new(raw_result)
end
raw_result() click to toggle source
# File lib/snov/get_profile_by_email.rb, line 32
def raw_result
  @raw_result ||= client.post("/v1/get-profile-by-email",
                              'email' => email)
                        .deep_transform_keys! { |key| key.underscore }
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/snov/get_profile_by_email.rb, line 28
def respond_to_missing?(method_name, include_private = false)
  prospect.respond_to?(method_name) || super
end