Module: Octokit::Client::Notifications
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/notifications.rb
Overview
Methods for the Notifications API
Instance Method Summary collapse
-
#delete_thread_subscription(thread_id, options = {}) ⇒ Boolean
Delete a thread subscription.
-
#mark_notifications_as_read(options = {}) ⇒ Boolean
Mark notifications as read.
-
#mark_repository_notifications_as_read(repo, options = {}) ⇒ Boolean
(also: #mark_repo_notifications_as_read)
Mark notifications from a specific repository as read.
-
#mark_thread_as_read(thread_id, options = {}) ⇒ Boolean
Mark thread as read.
-
#notifications(options = {}) ⇒ Array<Sawyer::Resource>
List your notifications.
-
#repository_notifications(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #repo_notifications)
List your notifications in a repository.
-
#thread_notifications(thread_id, options = {}) ⇒ Array<Sawyer::Resource>
List notifications for a specific thread.
-
#thread_subscription(thread_id, options = {}) ⇒ Sawyer::Resource
Get thread subscription.
-
#update_thread_subscription(thread_id, options = {}) ⇒ Sawyer::Resource
Update thread subscription.
Instance Method Details
#delete_thread_subscription(thread_id, options = {}) ⇒ Boolean
Delete a thread subscription
162 163 164 |
# File 'lib/octokit/client/notifications.rb', line 162 def delete_thread_subscription(thread_id, = {}) boolean_from_response :delete, "notifications/threads/#{thread_id}/subscription", end |
#mark_notifications_as_read(options = {}) ⇒ Boolean
Mark notifications as read
68 69 70 71 72 |
# File 'lib/octokit/client/notifications.rb', line 68 def mark_notifications_as_read( = {}) request :put, "notifications", last_response.status == 205 end |
#mark_repository_notifications_as_read(repo, options = {}) ⇒ Boolean Also known as: mark_repo_notifications_as_read
Mark notifications from a specific repository as read
89 90 91 92 93 |
# File 'lib/octokit/client/notifications.rb', line 89 def mark_repository_notifications_as_read(repo, = {}) request :put, "#{Repository.path repo}/notifications", last_response.status == 205 end |
#mark_thread_as_read(thread_id, options = {}) ⇒ Boolean
Mark thread as read
115 116 117 118 119 |
# File 'lib/octokit/client/notifications.rb', line 115 def mark_thread_as_read(thread_id, = {}) request :patch, "notifications/threads/#{thread_id}", last_response.status == 205 end |
#notifications(options = {}) ⇒ Array<Sawyer::Resource>
List your notifications
26 27 28 |
# File 'lib/octokit/client/notifications.rb', line 26 def notifications( = {}) paginate "notifications", end |
#repository_notifications(repo, options = {}) ⇒ Array<Sawyer::Resource> Also known as: repo_notifications
List your notifications in a repository
48 49 50 |
# File 'lib/octokit/client/notifications.rb', line 48 def repository_notifications(repo, = {}) paginate "#{Repository.path repo}/notifications", end |
#thread_notifications(thread_id, options = {}) ⇒ Array<Sawyer::Resource>
List notifications for a specific thread
104 105 106 |
# File 'lib/octokit/client/notifications.rb', line 104 def thread_notifications(thread_id, = {}) get "notifications/threads/#{thread_id}", end |
#thread_subscription(thread_id, options = {}) ⇒ Sawyer::Resource
Get thread subscription
128 129 130 |
# File 'lib/octokit/client/notifications.rb', line 128 def thread_subscription(thread_id, = {}) get "notifications/threads/#{thread_id}/subscription", end |
#update_thread_subscription(thread_id, options = {}) ⇒ Sawyer::Resource
Update thread subscription
This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned).
151 152 153 |
# File 'lib/octokit/client/notifications.rb', line 151 def update_thread_subscription(thread_id, = {}) put "notifications/threads/#{thread_id}/subscription", end |