Class: ClickUp::List
- Inherits:
-
APIResource
- Object
- APIResource
- ClickUp::List
- Extended by:
- APIOperations::All, APIOperations::Create, APIOperations::Get
- Defined in:
- lib/click_up/hierarchy/list.rb
Class Method Summary collapse
- .folder_path(folder_id) ⇒ Object
- .folderless_path(space_id) ⇒ Object
- .formatted_params(params) ⇒ Object
- .index_path(params = {}) ⇒ Object
- .rejected_params ⇒ Object
- .resource_path(params = {}) ⇒ Object
Methods included from APIOperations::All
Methods included from APIOperations::Create
Methods included from APIOperations::Get
Methods inherited from APIResource
Class Method Details
.folder_path(folder_id) ⇒ Object
20 21 22 |
# File 'lib/click_up/hierarchy/list.rb', line 20 def folder_path(folder_id) "/folder/#{folder_id}/list" end |
.folderless_path(space_id) ⇒ Object
24 25 26 |
# File 'lib/click_up/hierarchy/list.rb', line 24 def folderless_path(space_id) "/space/#{space_id}/list" end |
.formatted_params(params) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/click_up/hierarchy/list.rb', line 40 def formatted_params(params) params.reject {|key, _| rejected_params.include?(key) } # { # "name": "New List Name", # "content": "Sent from API V2", # "due_date": 1577811600000, # "due_date_time": false, # "priority": 1, # "assignee": 53480, # "status": "red" # } end |
.index_path(params = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/click_up/hierarchy/list.rb', line 10 def index_path(params={}) if params.has_key?(:folder_id) folder_path(params[:folder_id]) elsif params.has_key?(:space_id) folderless_path(params[:space_id]) else raise ArgumentError, "Either folder_id or space_id is required." end end |
.rejected_params ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/click_up/hierarchy/list.rb', line 32 def rejected_params [ :id, :folder_id, :space_id ] end |
.resource_path(params = {}) ⇒ Object
28 29 30 |
# File 'lib/click_up/hierarchy/list.rb', line 28 def resource_path(params={}) "/list/#{params[:id]}" end |