Class: Escobar::Heroku::Slug

Inherits:
Object
  • Object
show all
Defined in:
lib/escobar/heroku/slug.rb

Overview

Class representing a heroku slug

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, app_id, id) ⇒ Slug

Returns a new instance of Slug.



9
10
11
12
13
# File 'lib/escobar/heroku/slug.rb', line 9

def initialize(client, app_id, id)
  @id       = id
  @app_id   = app_id
  @client   = client
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



5
6
7
# File 'lib/escobar/heroku/slug.rb', line 5

def app_id
  @app_id
end

#app_nameObject (readonly)

Returns the value of attribute app_name.



5
6
7
# File 'lib/escobar/heroku/slug.rb', line 5

def app_name
  @app_name
end

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/escobar/heroku/slug.rb', line 5

def client
  @client
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/escobar/heroku/slug.rb', line 5

def id
  @id
end

#shaObject

Returns the value of attribute sha.



7
8
9
# File 'lib/escobar/heroku/slug.rb', line 7

def sha
  @sha
end

Instance Method Details

#infoObject



15
16
17
# File 'lib/escobar/heroku/slug.rb', line 15

def info
  @info ||= client.heroku.get("/apps/#{app_id}/slugs/#{id}")
end

#refObject



19
20
21
# File 'lib/escobar/heroku/slug.rb', line 19

def ref
  info["commit"]
end