Module: FileboundClient::Endpoints::Routes
- Defined in:
- lib/filebound_client/endpoints/routes.rb
Overview
Module for Routes resource endpoint
Class Method Summary collapse
Instance Method Summary collapse
-
#route_document_to_step(routed_item_id, step_number, comment:, due_date:, user_id:, checklist_data:, route_step_id:, route_step_task_id:) ⇒ nil
Routes a document to a specified step rubocop:disable Metrics/CyclomaticComplexity, Metrics/ParameterLists.
-
#route_document_to_user(document_id, user_id, route_back, due_date) ⇒ nil
Routes a document to a user.
-
#route_document_to_workflow(route_id, document_id, notes) ⇒ RoutedItem
Routes a document to the start of a workflow.
-
#route_xml(route_id, query_params = nil) ⇒ string
Retrieves xml for a route.
Class Method Details
.included(klass) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/filebound_client/endpoints/routes.rb', line 5 def self.included(klass) klass.instance_eval do allow_new :route allow_all :routes end end |
Instance Method Details
#route_document_to_step(routed_item_id, step_number, comment:, due_date:, user_id:, checklist_data:, route_step_id:, route_step_task_id:) ⇒ nil
Routes a document to a specified step rubocop:disable Metrics/CyclomaticComplexity, Metrics/ParameterLists
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/filebound_client/endpoints/routes.rb', line 42 def route_document_to_step(routed_item_id, step_number, comment:, due_date:, user_id:, checklist_data:, route_step_id:, route_step_task_id:) params = { id: routed_item_id, stepNumber: step_number } params[:comment] = comment if comment params[:dueDate] = due_date if due_date params[:userId] = user_id if user_id params[:checklistData] = checklist_data if checklist_data params[:routeStepId] = route_step_id if route_step_id params[:routeStepTaskId] = route_step_task_id if route_step_task_id put('/routes', params, nil) end |
#route_document_to_user(document_id, user_id, route_back, due_date) ⇒ nil
Routes a document to a user
61 62 63 64 |
# File 'lib/filebound_client/endpoints/routes.rb', line 61 def route_document_to_user(document_id, user_id, route_back, due_date) params = { documentId: document_id, userId: user_id, routeBack: route_back, dueDate: due_date } put('/routes', params, nil) end |
#route_document_to_workflow(route_id, document_id, notes) ⇒ RoutedItem
Routes a document to the start of a workflow
25 26 27 28 29 |
# File 'lib/filebound_client/endpoints/routes.rb', line 25 def route_document_to_workflow(route_id, document_id, notes) params = { documentId: document_id } params[:notes] = notes if notes put("/routes/#{route_id}", params, nil) end |
#route_xml(route_id, query_params = nil) ⇒ string
Retrieves xml for a route
16 17 18 |
# File 'lib/filebound_client/endpoints/routes.rb', line 16 def route_xml(route_id, query_params = nil) get("/routes/#{route_id}/xml", query_params) end |