Class: Roseflow::LinkedIn::Person::RoleQuery

Inherits:
Proxycurl::ProxycurlObject show all
Defined in:
lib/roseflow/linkedin/person/role_query.rb

Defined Under Namespace

Classes: RoleQueryContract

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(input) ⇒ Object

Raises:

  • (ArgumentError)


28
29
30
31
32
# File 'lib/roseflow/linkedin/person/role_query.rb', line 28

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



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/roseflow/linkedin/person/role_query.rb', line 34

def to_request_params
  params = {
    company_name: company_name,
    role: role,
    enrich_profile: enrich == true ? "enrich" : "skip",
  }

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