Module: Octokit::Client::Notifications
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/notifications.rb |
Overview
Methods for the Notifications
API
Instance Method Summary
-
#delete_thread_subscription(thread_id, options = {}) ⇒ Boolean
Delete a thread subscription.
-
#mark_notifications_as_read(options = {}) ⇒ Boolean
Mark notifications as read.
-
#mark_repo_notifications_as_read(repo, options = {})
Alias for #mark_repository_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.
-
#repo_notifications(repo, options = {})
Alias for #repository_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
# 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
# File 'lib/octokit/client/notifications.rb', line 68
def mark_notifications_as_read( = {}) request :put, 'notifications', last_response.status == 205 end
#mark_repo_notifications_as_read(repo, options = {})
Alias for #mark_repository_notifications_as_read.
# File 'lib/octokit/client/notifications.rb', line 94
alias mark_repo_notifications_as_read mark_repository_notifications_as_read
#mark_repository_notifications_as_read(repo, options = {}) ⇒ Boolean
Also known as: #mark_repo_notifications_as_read
Mark notifications from a specific repository as read
# 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
# 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
# File 'lib/octokit/client/notifications.rb', line 26
def notifications( = {}) paginate 'notifications', end
#repo_notifications(repo, options = {})
Alias for #repository_notifications.
# File 'lib/octokit/client/notifications.rb', line 51
alias repo_notifications repository_notifications
#repository_notifications(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #repo_notifications
List your notifications in a repository
# 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
# 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
# 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).
# File 'lib/octokit/client/notifications.rb', line 151
def update_thread_subscription(thread_id, = {}) put "notifications/threads/#{thread_id}/subscription", end