Class: PipedriveOrbit::Orbit

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

Class Method Summary collapse

Class Method Details

.call(type:, data:, orbit_workspace:, orbit_api_key:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pipedrive_orbit/orbit.rb', line 5

def self.call(type:, data:, orbit_workspace:, orbit_api_key:)
  if type == "note"
    PipedriveOrbit::Interactions::Note.new(
      note: data[:note],
      pipedrive_url: data[:pipedrive_url],
      orbit_workspace: orbit_workspace,
      orbit_api_key: orbit_api_key
    )
  end

  if type == "activity"
    PipedriveOrbit::Interactions::Activity.new(
      activity: data[:activity],
      pipedrive_url: data[:pipedrive_url],
      orbit_workspace: orbit_workspace,
      orbit_api_key: orbit_api_key
    )
  end

  if type == "person_note"
    PipedriveOrbit::Interactions::PersonNote.new(
      note: data[:note],
      pipedrive_url: data[:pipedrive_url],
      orbit_workspace: orbit_workspace,
      orbit_api_key: orbit_api_key
    )
  end
end