Class: Honeybadger::Api::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/honeybadger-api/deploy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#changelogObject (readonly)

Returns the value of attribute changelog.



5
6
7
# File 'lib/honeybadger-api/deploy.rb', line 5

def changelog
  @changelog
end

#created_atObject (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

#environmentObject (readonly)

Returns the value of attribute environment.



5
6
7
# File 'lib/honeybadger-api/deploy.rb', line 5

def environment
  @environment
end

#local_usernameObject (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

#repositoryObject (readonly)

Returns the value of attribute repository.



5
6
7
# File 'lib/honeybadger-api/deploy.rb', line 5

def repository
  @repository
end

#revisionObject (readonly)

Returns the value of attribute revision.



5
6
7
# File 'lib/honeybadger-api/deploy.rb', line 5

def revision
  @revision
end

#urlObject (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

.handlerObject

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