Class: PipedriveOrbit::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



35
36
37
38
39
40
# File 'lib/pipedrive_orbit/client.rb', line 35

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"])
  @pipedrive_api_key = params.fetch(:pipedrive_api_key, ENV["PIPEDRIVE_API_KEY"])
  @pipedrive_url = params.fetch(:pipedrive_url, ENV["PIPEDRIVE_URL"])
end

Instance Attribute Details

#orbit_api_keyObject

Returns the value of attribute orbit_api_key.



33
34
35
# File 'lib/pipedrive_orbit/client.rb', line 33

def orbit_api_key
  @orbit_api_key
end

#orbit_workspaceObject

Returns the value of attribute orbit_workspace.



33
34
35
# File 'lib/pipedrive_orbit/client.rb', line 33

def orbit_workspace
  @orbit_workspace
end

#pipedrive_api_keyObject

Returns the value of attribute pipedrive_api_key.



33
34
35
# File 'lib/pipedrive_orbit/client.rb', line 33

def pipedrive_api_key
  @pipedrive_api_key
end

#pipedrive_urlObject

Returns the value of attribute pipedrive_url.



33
34
35
# File 'lib/pipedrive_orbit/client.rb', line 33

def pipedrive_url
  @pipedrive_url
end

Instance Method Details

#activitiesObject



51
52
53
54
55
56
57
58
# File 'lib/pipedrive_orbit/client.rb', line 51

def activities
  PipedriveOrbit::Pipedrive.new(
    pipedrive_api_key: @pipedrive_api_key,
    pipedrive_url: @pipedrive_url,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace
  ).process_activities
end

#notesObject



42
43
44
45
46
47
48
49
# File 'lib/pipedrive_orbit/client.rb', line 42

def notes
  PipedriveOrbit::Pipedrive.new(
    pipedrive_api_key: @pipedrive_api_key,
    pipedrive_url: @pipedrive_url,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace
  ).process_notes
end

#people_notesObject



60
61
62
63
64
65
66
67
# File 'lib/pipedrive_orbit/client.rb', line 60

def people_notes
  PipedriveOrbit::Pipedrive.new(
    pipedrive_api_key: @pipedrive_api_key,
    pipedrive_url: @pipedrive_url,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace
  ).process_people_notes
end