Class: Melaya::BugsAPI
- Inherits:
-
Object
- Object
- Melaya::BugsAPI
- Defined in:
- lib/melaya/bugs.rb
Overview
Bugs API — submit and track bug reports.
Maps to /api/v1/private/bugs/*.
Instance Method Summary collapse
-
#add_comment(bug_id, comment:) ⇒ Object
POST /api/v1/private/bugs/:bugId/comments Add a comment to a bug report.
-
#create(title:, description: nil, **extra) ⇒ Object
POST /api/v1/private/bugs Submit a bug report (user-facing feedback form).
-
#get(bug_id) ⇒ Object
GET /api/v1/private/bugs/:bugId Get a single bug report by ID.
-
#initialize(http) ⇒ BugsAPI
constructor
A new instance of BugsAPI.
-
#list_mine ⇒ Object
GET /api/v1/private/bugs/mine List bug reports submitted by the caller.
-
#list_notifications ⇒ Object
GET /api/v1/private/bugs/notifications List unread bug-related notifications for the caller.
-
#mark_notifications_read(body = {}) ⇒ Object
POST /api/v1/private/bugs/notifications/read Mark bug notifications as read.
Constructor Details
#initialize(http) ⇒ BugsAPI
Returns a new instance of BugsAPI.
12 13 14 |
# File 'lib/melaya/bugs.rb', line 12 def initialize(http) @http = http end |
Instance Method Details
#add_comment(bug_id, comment:) ⇒ Object
POST /api/v1/private/bugs/:bugId/comments Add a comment to a bug report.
45 46 47 |
# File 'lib/melaya/bugs.rb', line 45 def add_comment(bug_id, comment:) @http.post("/api/v1/private/bugs/#{enc(bug_id)}/comments", "comment" => comment) end |
#create(title:, description: nil, **extra) ⇒ Object
POST /api/v1/private/bugs Submit a bug report (user-facing feedback form).
21 22 23 24 25 26 |
# File 'lib/melaya/bugs.rb', line 21 def create(title:, description: nil, **extra) body = extra.transform_keys(&:to_s) body["title"] = title body["description"] = description unless description.nil? @http.post("/api/v1/private/bugs", body) end |
#get(bug_id) ⇒ Object
GET /api/v1/private/bugs/:bugId Get a single bug report by ID.
37 38 39 |
# File 'lib/melaya/bugs.rb', line 37 def get(bug_id) @http.get("/api/v1/private/bugs/#{enc(bug_id)}") end |
#list_mine ⇒ Object
GET /api/v1/private/bugs/mine List bug reports submitted by the caller.
30 31 32 |
# File 'lib/melaya/bugs.rb', line 30 def list_mine @http.get("/api/v1/private/bugs/mine") end |
#list_notifications ⇒ Object
GET /api/v1/private/bugs/notifications List unread bug-related notifications for the caller.
51 52 53 |
# File 'lib/melaya/bugs.rb', line 51 def list_notifications @http.get("/api/v1/private/bugs/notifications") end |
#mark_notifications_read(body = {}) ⇒ Object
POST /api/v1/private/bugs/notifications/read Mark bug notifications as read.
57 58 59 |
# File 'lib/melaya/bugs.rb', line 57 def mark_notifications_read(body = {}) @http.post("/api/v1/private/bugs/notifications/read", body) end |