class Honeybadger::Api::Project
Attributes
created_at[R]
earliest_notice_at[R]
environments[R]
fault_count[R]
id[R]
last_notice_at[R]
name[R]
owner[R]
teams[R]
token[R]
unresolved_fault_count[R]
users[R]
Public Class Methods
all()
click to toggle source
Public: Find all of the project.
# File lib/honeybadger-api/project.rb, line 52 def self.all Honeybadger::Api::Request.all("projects", handler) end
find(project_id)
click to toggle source
Public: Find a project.
# File lib/honeybadger-api/project.rb, line 62 def self.find(project_id) Honeybadger::Api::Request.find("projects/#{project_id}", handler) end
handler()
click to toggle source
Internal: The handler used to build objects from API responses.
# File lib/honeybadger-api/project.rb, line 67 def self.handler Proc.new { |response| Project.new(response) } end
new(opts)
click to toggle source
Public: Build a new instance of Project
opts - A Hash of attributes to initialize a Project
Returns a new Project
# File lib/honeybadger-api/project.rb, line 14 def initialize(opts) @id = opts[:id] @name = opts[:name] @owner = User.new(opts[:owner][:name], opts[:owner][:email]) @users = opts[:users].collect { |user| User.new(user[:name], user[:email]) } @token = opts[:token] @environments = opts[:environments] @teams = opts[:teams] @active = opts[:active] @disable_public_links = opts[:disable_public_links] @fault_count = opts[:fault_count] @unresolved_fault_count = opts[:unresolved_fault_count] @last_notice_at = opts[:last_notice_at].nil? ? nil : DateTime.parse(opts[:last_notice_at]) @earliest_notice_at = opts[:earliest_notice_at].nil? ? nil : DateTime.parse(opts[:earliest_notice_at]) @created_at = opts[:created_at].nil? ? nil : DateTime.parse(opts[:created_at]) end
paginate(filters = {})
click to toggle source
Public: Paginate all of the project.
# File lib/honeybadger-api/project.rb, line 57 def self.paginate(filters = {}) Honeybadger::Api::Request.paginate("projects", handler, filters) end
Public Instance Methods
active?()
click to toggle source
Public: Whether the project is active.
# File lib/honeybadger-api/project.rb, line 32 def active? @active == true end
inactive?()
click to toggle source
Public: Whether the project is inactive.
# File lib/honeybadger-api/project.rb, line 37 def inactive? @active == false end
private_links?()
click to toggle source
Public: Whether links are private.
# File lib/honeybadger-api/project.rb, line 47 def private_links? @disable_public_links == true end
public_links?()
click to toggle source
Public: Whether links are public.
# File lib/honeybadger-api/project.rb, line 42 def public_links? @disable_public_links == false end