Class: Honeybadger::Api::Deploy
- Inherits:
-
Object
- Object
- Honeybadger::Api::Deploy
- Defined in:
- lib/honeybadger-api/deploy.rb
Instance Attribute Summary collapse
-
#changelog ⇒ Object
readonly
Returns the value of attribute changelog.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#local_username ⇒ Object
readonly
Returns the value of attribute local_username.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.all(project_id) ⇒ Object
Public: Find all deploys for a given project.
-
.find(project_id, deploy_id) ⇒ Object
Public: Find a deploy for a given project.
-
.handler ⇒ Object
Internal: The handler used to build objects from API responses.
-
.paginate(project_id, filters = {}) ⇒ Object
Public: Paginate all deploys for a given project.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Deploy
constructor
Public: Build a new instance of Deploy.
Constructor Details
#initialize(opts) ⇒ Deploy
Public: Build a new instance of Deploy
opts - A Hash of attributes to initialize a Deploy
Returns a new Deploy
13 14 15 16 17 18 19 20 21 |
# File 'lib/honeybadger-api/deploy.rb', line 13 def initialize(opts) @url = opts[:url] @repository = opts[:repository] @revision = opts[:revision] @environment = opts[:environment] @changelog = opts[:changelog] @local_username = opts[:local_username] @created_at = opts[:created_at].nil? ? nil : DateTime.parse(opts[:created_at]) end |
Instance Attribute Details
#changelog ⇒ Object (readonly)
Returns the value of attribute changelog.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def changelog @changelog end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def created_at @created_at end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def environment @environment end |
#local_username ⇒ Object (readonly)
Returns the value of attribute local_username.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def local_username @local_username end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def repository @repository end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def revision @revision end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/honeybadger-api/deploy.rb', line 5 def url @url end |
Class Method Details
.all(project_id) ⇒ Object
Public: Find all deploys for a given project.
24 25 26 27 |
# File 'lib/honeybadger-api/deploy.rb', line 24 def self.all(project_id) path = "projects/#{project_id}/deploys" Honeybadger::Api::Request.all(path, handler) end |
.find(project_id, deploy_id) ⇒ Object
Public: Find a deploy for a given project.
36 37 38 39 |
# File 'lib/honeybadger-api/deploy.rb', line 36 def self.find(project_id, deploy_id) path = "projects/#{project_id}/deploys/#{deploy_id}" Honeybadger::Api::Request.find(path, handler) end |
.handler ⇒ Object
Internal: The handler used to build objects from API responses.
42 43 44 |
# File 'lib/honeybadger-api/deploy.rb', line 42 def self.handler Proc.new { |response| Deploy.new(response) } end |
.paginate(project_id, filters = {}) ⇒ Object
Public: Paginate all deploys for a given project
30 31 32 33 |
# File 'lib/honeybadger-api/deploy.rb', line 30 def self.paginate(project_id, filters = {}) path = "projects/#{project_id}/deploys" Honeybadger::Api::Request.paginate(path, handler, filters) end |