lib/athena_health/endpoints/departments.rb in athena_health-0.6.0 vs lib/athena_health/endpoints/departments.rb in athena_health-0.7.0
- old
+ new
@@ -1,14 +1,24 @@
module AthenaHealth
module Endpoints
module Departments
def all_departments(practice_id:, params: {})
- response = @api.call(endpoint: "#{practice_id}/departments", method: :get, params: params)
+ response = @api.call(
+ endpoint: "#{practice_id}/departments",
+ method: :get,
+ params: params
+ )
+
DepartmentCollection.new(response)
end
def find_department(practice_id:, department_id:, params: {})
- response = @api.call(endpoint: "#{practice_id}/departments/#{department_id}", method: :get, params: params)
+ response = @api.call(
+ endpoint: "#{practice_id}/departments/#{department_id}",
+ method: :get,
+ params: params
+ )
+
Department.new(response.first)
end
end
end
end