Parent

Included Modules

Class/Module Index [+]

Quicksearch

Heroku::Helpers::HerokuPostgresql::Resolver

Attributes

api[R]
app_name[R]

Public Class Methods

new(app_name, api) click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 46
def initialize(app_name, api)
  @app_name = app_name
  @api = api
end

Public Instance Methods

all_databases() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 61
def all_databases
  hpg_databases
end
database_name_from_url(url) click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 65
def database_name_from_url(url)
  vars = app_config_vars.reject {|key,value| key == 'DATABASE_URL'}
  if var = vars.invert[url]
    var.gsub(/_URL$/, '')
  else
    uri = URI.parse(url)
    "Database on #{uri.host}:#{uri.port || 5432}#{uri.path}"
  end
end
hpg_addon_name() click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 75
def hpg_addon_name
  if ENV['SHOGUN']
    "shogun-#{ENV['SHOGUN']}"
  else
    ENV['HEROKU_POSTGRESQL_ADDON_NAME'] || 'heroku-postgresql'
  end
end
resolve(identifier, default=nil) click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 51
def resolve(identifier, default=nil)
  if identifier =~ /::/
    @app_name, db_name = identifier.split('::')
  else
    db_name = identifier
  end

  hpg_resolve(db_name, default)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.