Class: Honeybadger::Api::Notice
- Inherits:
-
Object
- Object
- Honeybadger::Api::Notice
- Defined in:
- lib/honeybadger-api/notice.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#deploy ⇒ Object
readonly
Returns the value of attribute deploy.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#environment_name ⇒ Object
readonly
Returns the value of attribute environment_name.
-
#fault_id ⇒ Object
readonly
Returns the value of attribute fault_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#web_environment ⇒ Object
readonly
Returns the value of attribute web_environment.
Class Method Summary collapse
-
.all(project_id, fault_id) ⇒ Object
Public: Find all notices on a fault for a project.
-
.handler ⇒ Object
Internal: The handler used to build objects from API responses.
-
.paginate(project_id, fault_id, filters = {}) ⇒ Object
Public: Paginate all notices on a fault for a project.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Notice
constructor
Public: Build a new instance of Notice.
Constructor Details
#initialize(opts) ⇒ Notice
Public: Build a new instance of Notice
opts - A Hash of attributes to initialize a Notice
Returns a new Notice
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/honeybadger-api/notice.rb', line 13 def initialize(opts) @id = opts[:id] @url = opts[:url] @fault_id = opts[:fault_id] @environment = opts[:environment] @environment_name = opts[:environment_name] @cookies = opts[:cookies] @web_environment = opts[:web_environment] @backtrace = opts[:backtrace] @deploy = Deploy.new(opts[:deploy]) if !opts[:deploy].nil? @message = opts[:message] @request = opts[:request] @created_at = opts[:created_at].nil? ? nil : DateTime.parse(opts[:created_at]) end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def backtrace @backtrace end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def @cookies end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def created_at @created_at end |
#deploy ⇒ Object (readonly)
Returns the value of attribute deploy.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def deploy @deploy end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def environment @environment end |
#environment_name ⇒ Object (readonly)
Returns the value of attribute environment_name.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def environment_name @environment_name end |
#fault_id ⇒ Object (readonly)
Returns the value of attribute fault_id.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def fault_id @fault_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def id @id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def @message end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def request @request end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def url @url end |
#web_environment ⇒ Object (readonly)
Returns the value of attribute web_environment.
5 6 7 |
# File 'lib/honeybadger-api/notice.rb', line 5 def web_environment @web_environment end |
Class Method Details
.all(project_id, fault_id) ⇒ Object
Public: Find all notices on a fault for a project.
29 30 31 32 |
# File 'lib/honeybadger-api/notice.rb', line 29 def self.all(project_id, fault_id) path = "projects/#{project_id}/faults/#{fault_id}/notices" Honeybadger::Api::Request.all(path, handler) end |
.handler ⇒ Object
Internal: The handler used to build objects from API responses.
41 42 43 |
# File 'lib/honeybadger-api/notice.rb', line 41 def self.handler Proc.new { |response| Notice.new(response) } end |
.paginate(project_id, fault_id, filters = {}) ⇒ Object
Public: Paginate all notices on a fault for a project
35 36 37 38 |
# File 'lib/honeybadger-api/notice.rb', line 35 def self.paginate(project_id, fault_id, filters = {}) path = "projects/#{project_id}/faults/#{fault_id}/notices" Honeybadger::Api::Request.paginate(path, handler, filters) end |