Module: Instapaper::API::Folders
- Included in:
- Instapaper::API
- Defined in:
- lib/instapaper/api/folders.rb
Overview
Defines methods related to folders
Instance Method Summary collapse
-
#add_folder(title) ⇒ Object
Creates an organizational folder.
-
#delete_folder(folder_id) ⇒ Object
Deletes the folder and moves any articles in it to the Archive.
-
#folders ⇒ Object
List the account’s user-created folders.
-
#set_order(order = []) ⇒ Object
Re-orders a user’s folders.
Instance Method Details
#add_folder(title) ⇒ Object
Creates an organizational folder.
15 16 17 |
# File 'lib/instapaper/api/folders.rb', line 15 def add_folder(title) perform_post_with_object('/api/1.1/folders/add', {title: title}, Instapaper::Folder) end |
#delete_folder(folder_id) ⇒ Object
Deletes the folder and moves any articles in it to the Archive.
21 22 23 24 |
# File 'lib/instapaper/api/folders.rb', line 21 def delete_folder(folder_id) perform_post_with_unparsed_response('/api/1.1/folders/delete', folder_id: folder_id) true end |
#folders ⇒ Object
Note:
This only includes organizational folders and does not include RSS-feed folders or starred-subscription folders
List the account’s user-created folders.
9 10 11 |
# File 'lib/instapaper/api/folders.rb', line 9 def folders perform_post_with_objects('/api/1.1/folders/list', {}, Instapaper::Folder) end |
#set_order(order = []) ⇒ Object
Re-orders a user’s folders.
30 31 32 |
# File 'lib/instapaper/api/folders.rb', line 30 def set_order(order = []) # rubocop:disable Naming/AccessorMethodName perform_post_with_objects('/api/1.1/folders/set_order', {order: order.join(',')}, Instapaper::Folder) end |