Class: Heroku::Helpers::HerokuPostgresql::Attachment
- Inherits:
-
Object
- Object
- Heroku::Helpers::HerokuPostgresql::Attachment
- Defined in:
- lib/heroku/helpers/heroku_postgresql.rb
Instance Attribute Summary collapse
-
#addon ⇒ Object
readonly
Returns the value of attribute addon.
-
#config_var ⇒ Object
readonly
Returns the value of attribute config_var.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(raw) ⇒ Attachment
constructor
A new instance of Attachment.
- #primary_attachment! ⇒ Object
- #primary_attachment? ⇒ Boolean
- #starter_plan? ⇒ Boolean
Constructor Details
#initialize(raw) ⇒ Attachment
Returns a new instance of Attachment.
10 11 12 13 14 15 16 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 10 def initialize(raw) @raw = raw @config_var = raw['config_var'] @resource_name = raw['resource']['name'] @url = raw['resource']['value'] @addon, @plan = raw['resource']['type'].split(':') end |
Instance Attribute Details
#addon ⇒ Object (readonly)
Returns the value of attribute addon.
9 10 11 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 9 def addon @addon end |
#config_var ⇒ Object (readonly)
Returns the value of attribute config_var.
9 10 11 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 9 def config_var @config_var end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
9 10 11 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 9 def plan @plan end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
9 10 11 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 9 def resource_name @resource_name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 9 def url @url end |
Instance Method Details
#display_name ⇒ Object
22 23 24 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 22 def display_name config_var + ( ? " (DATABASE_URL)" : '') end |
#primary_attachment! ⇒ Object
26 27 28 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 26 def @primary_attachment = true end |
#primary_attachment? ⇒ Boolean
30 31 32 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 30 def @primary_attachment end |
#starter_plan? ⇒ Boolean
18 19 20 |
# File 'lib/heroku/helpers/heroku_postgresql.rb', line 18 def starter_plan? plan =~ /dev|basic/ end |