Class: PlanningcenterOrbit::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



38
39
40
41
42
43
44
# File 'lib/planningcenter_orbit/client.rb', line 38

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"])
  @pc_app_id = params.fetch(:pc_app_id, ENV["PLANNING_CENTER_APP_ID"])
  @pc_api_secret = params.fetch(:pc_api_secret, ENV["PLANNING_CENTER_API_SECRET"])
  @historical_import = params.fetch(:historical_import, false)
end

Instance Attribute Details

#historical_importObject

Returns the value of attribute historical_import.



36
37
38
# File 'lib/planningcenter_orbit/client.rb', line 36

def historical_import
  @historical_import
end

#orbit_api_keyObject

Returns the value of attribute orbit_api_key.



36
37
38
# File 'lib/planningcenter_orbit/client.rb', line 36

def orbit_api_key
  @orbit_api_key
end

#orbit_workspaceObject

Returns the value of attribute orbit_workspace.



36
37
38
# File 'lib/planningcenter_orbit/client.rb', line 36

def orbit_workspace
  @orbit_workspace
end

#pc_api_secretObject

Returns the value of attribute pc_api_secret.



36
37
38
# File 'lib/planningcenter_orbit/client.rb', line 36

def pc_api_secret
  @pc_api_secret
end

#pc_app_idObject

Returns the value of attribute pc_app_id.



36
37
38
# File 'lib/planningcenter_orbit/client.rb', line 36

def pc_app_id
  @pc_app_id
end

Instance Method Details

#check_insObject



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

def check_ins
  PlanningcenterOrbit::Planningcenter.new(
    pc_app_id: @pc_app_id,
    pc_api_secret: @pc_api_secret,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace,
    historical_import: @historical_import
  ).process_checkins
end