class Honeybadger::Api::Comment

Attributes

author[R]
body[R]
created_at[R]
email[R]
event[R]
fault_id[R]
id[R]
notices_count[R]
source[R]

Public Class Methods

all(project_id, fault_id) click to toggle source

Public: Find all comments on a fault for a project.

# File lib/honeybadger-api/comment.rb, line 25
def self.all(project_id, fault_id)
  path = "projects/#{project_id}/faults/#{fault_id}/comments"
  Honeybadger::Api::Request.all(path, handler)
end
find(project_id, fault_id, comment_id) click to toggle source

Public: Find a comment on a fault for a project.

# File lib/honeybadger-api/comment.rb, line 37
def self.find(project_id, fault_id, comment_id)
  path = "projects/#{project_id}/faults/#{fault_id}/comments/#{comment_id}"
  Honeybadger::Api::Request.find(path, handler)
end
handler() click to toggle source

Internal: The handler used to build objects from API responses.

# File lib/honeybadger-api/comment.rb, line 43
def self.handler
  Proc.new { |response| Comment.new(response) }
end
new(opts) click to toggle source

Public: Build a new instance of Comment

opts - A Hash of attributes to initialize a Comment

Returns a new Comment

# File lib/honeybadger-api/comment.rb, line 12
def initialize(opts)
  @id = opts[:id]
  @fault_id = opts[:fault_id]
  @event = opts[:event]
  @source = opts[:source]
  @notices_count = opts[:notices_count]
  @author = opts[:author]
  @body = opts[:body]
  @email = opts[:email]
  @created_at = opts[:created_at].nil? ? nil : DateTime.parse(opts[:created_at])
end
paginate(project_id, fault_id, filters = {}) click to toggle source

Public: Paginate all comments on a fault for a project

# File lib/honeybadger-api/comment.rb, line 31
def self.paginate(project_id, fault_id, filters = {})
  path = "projects/#{project_id}/faults/#{fault_id}/comments"
  Honeybadger::Api::Request.paginate(path, handler, filters)
end