class Heroku::Helpers::HerokuPostgresql::Attachment

Attributes

addon[R]
config_var[R]
plan[R]
resource_name[R]
url[R]

Public Class Methods

new(raw) click to toggle source
# 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

Public Instance Methods

display_name() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 22
def display_name
  config_var + (primary_attachment? ? " (DATABASE_URL)"  : '')
end
primary_attachment!() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 26
def primary_attachment!
  @primary_attachment = true
end
primary_attachment?() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 30
def primary_attachment?
  @primary_attachment
end
starter_plan?() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 18
def starter_plan?
  plan =~ /dev|basic/
end