Class: Roseflow::LinkedIn::Company::LookupQuery

Inherits:
Proxycurl::ProxycurlObject show all
Defined in:
lib/roseflow/linkedin/company/lookup_query.rb

Defined Under Namespace

Classes: LookupQueryContract

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(input) ⇒ Object

Raises:

  • (ArgumentError)


38
39
40
41
42
# File 'lib/roseflow/linkedin/company/lookup_query.rb', line 38

def self.new(input)
  validation = self.contract_object.new.call(input)
  raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
  super(input)
end

Instance Method Details

#to_request_paramsObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/roseflow/linkedin/company/lookup_query.rb', line 44

def to_request_params
  params = {
    company_domain: domain,
    company_name: name,
    company_location: location,
    enrich_profile: enrich,
  }

  params.each_pair do |key, value|
    params.delete(key) unless value
  end
end