Module: Octokit::Client::Notifications
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/notifications.rb
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<Hashie::Mash>
List your notifications.
-
#repository_notifications(repo, options = {}) ⇒ Array<Hashie::Mash>
(also: #repo_notifications)
List your notifications in a repository.
-
#thread_notifications(thread_id, options = {}) ⇒ Array<Hashie::Mashie>
List notifications for a specific thread.
-
#thread_subscription(thread_id, options = {}) ⇒ Hashie::Mash
Get thread subscription.
-
#update_thread_subscription(thread_id, options = {}) ⇒ Hashie::Mash
Update thread subscription.
Instance Method Details
#delete_thread_subscription(thread_id, options = {}) ⇒ Boolean
Delete a thread subscription
212 213 214 |
# File 'lib/octokit/client/notifications.rb', line 212 def delete_thread_subscription(thread_id, ={}) boolean_from_response(:delete, "notifications/threads/#{thread_id}", ) end |
#mark_notifications_as_read(options = {}) ⇒ Boolean
Mark notifications as read
83 84 85 86 87 88 89 |
# File 'lib/octokit/client/notifications.rb', line 83 def mark_notifications_as_read(={}) begin request(:put, "notifications", ).status == 205 rescue false end 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
112 113 114 115 116 117 118 |
# File 'lib/octokit/client/notifications.rb', line 112 def mark_repository_notifications_as_read(repo, ={}) begin request(:put, "repos/#{Repository.new repo}/notifications", ).status == 205 rescue false end end |
#mark_thread_as_read(thread_id, options = {}) ⇒ Boolean
Mark thread as read
151 152 153 154 155 156 157 |
# File 'lib/octokit/client/notifications.rb', line 151 def mark_thread_as_read(thread_id, ={}) begin request(:patch, "notifications/threads/#{thread_id}", ).status == 205 rescue false end end |
#notifications(options = {}) ⇒ Array<Hashie::Mash>
List your notifications
29 30 31 |
# File 'lib/octokit/client/notifications.rb', line 29 def notifications(={}) get("notifications", ) end |
#repository_notifications(repo, options = {}) ⇒ Array<Hashie::Mash> Also known as: repo_notifications
List your notifications in a repository
58 59 60 |
# File 'lib/octokit/client/notifications.rb', line 58 def repository_notifications(repo, ={}) get("repos/#{Repository.new repo}/notifications", ) end |
#thread_notifications(thread_id, options = {}) ⇒ Array<Hashie::Mashie>
List notifications for a specific thread
131 132 133 |
# File 'lib/octokit/client/notifications.rb', line 131 def thread_notifications(thread_id, ={}) get("notifications/threads/#{thread_id}", ) end |
#thread_subscription(thread_id, options = {}) ⇒ Hashie::Mash
Get thread subscription
169 170 171 |
# File 'lib/octokit/client/notifications.rb', line 169 def thread_subscription(thread_id, ={}) get("notifications/threads/#{thread_id}/subscription", ) end |
#update_thread_subscription(thread_id, options = {}) ⇒ Hashie::Mash
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).
198 199 200 |
# File 'lib/octokit/client/notifications.rb', line 198 def update_thread_subscription(thread_id, ={}) put("notifications/threads/#{thread_id}/subscription", ) end |