Class: LinkedinOrbit::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/linkedin_orbit/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



46
47
48
49
50
51
52
# File 'lib/linkedin_orbit/client.rb', line 46

def initialize(params = {})
  @orbit_api_key = params.fetch(:orbit_api_key, ENV["ORBIT_API_KEY"])
  @orbit_workspace = params.fetch(:orbit_workspace, ENV["ORBIT_WORKSPACE_ID"])
  @linkedin_token = token
  @linkedin_organization = params.fetch(:linkedin_organization, ENV["LINKEDIN_ORGANIZATION"])
  @historical_import = params.fetch(:historical_import, false)
end

Instance Attribute Details

#historical_importObject

Returns the value of attribute historical_import.



43
44
45
# File 'lib/linkedin_orbit/client.rb', line 43

def historical_import
  @historical_import
end

#linkedin_organizationObject

Returns the value of attribute linkedin_organization.



43
44
45
# File 'lib/linkedin_orbit/client.rb', line 43

def linkedin_organization
  @linkedin_organization
end

#linkedin_tokenObject (readonly)

Returns the value of attribute linkedin_token.



44
45
46
# File 'lib/linkedin_orbit/client.rb', line 44

def linkedin_token
  @linkedin_token
end

#orbit_api_keyObject

Returns the value of attribute orbit_api_key.



43
44
45
# File 'lib/linkedin_orbit/client.rb', line 43

def orbit_api_key
  @orbit_api_key
end

#orbit_workspaceObject

Returns the value of attribute orbit_workspace.



43
44
45
# File 'lib/linkedin_orbit/client.rb', line 43

def orbit_workspace
  @orbit_workspace
end

Instance Method Details

#commentsObject



58
59
60
61
62
63
64
65
66
# File 'lib/linkedin_orbit/client.rb', line 58

def comments
  LinkedinOrbit::Linkedin.new(
    linkedin_token: @linkedin_token,
    linkedin_organization: @linkedin_organization,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace,
    historical_import: @historical_import
  ).process_comments
end

#tokenObject



54
55
56
# File 'lib/linkedin_orbit/client.rb', line 54

def token
  @token ||= ENV["LINKEDIN_TOKEN"]
end