class CF::App::Credentials

Attributes

locator[R]

Public Class Methods

find_all_by_all_service_tags(tags) click to toggle source

Returns credentials for the service instances with all the given tags.

# File lib/cf-app-utils/cf/app/credentials.rb, line 13
def find_all_by_all_service_tags(tags)
  credentials.find_all_by_all_service_tags(tags)
end
find_all_by_service_label(label) click to toggle source

Returns credentials for all service instances with the given label.

# File lib/cf-app-utils/cf/app/credentials.rb, line 28
def find_all_by_service_label(label)
  credentials.find_all_by_service_label(label)
end
find_all_by_service_tag(tag) click to toggle source
# File lib/cf-app-utils/cf/app/credentials.rb, line 8
def find_all_by_service_tag(tag)
  credentials.find_all_by_service_tag(tag)
end
find_by_service_label(label) click to toggle source

Returns credentials for the first service instance with the given label.

# File lib/cf-app-utils/cf/app/credentials.rb, line 23
def find_by_service_label(label)
  credentials.find_by_service_label(label)
end
find_by_service_name(name) click to toggle source
# File lib/cf-app-utils/cf/app/credentials.rb, line 4
def find_by_service_name(name)
  credentials.find_by_service_name(name)
end
find_by_service_tag(tag) click to toggle source

Returns credentials for the first service instance with the given tag.

# File lib/cf-app-utils/cf/app/credentials.rb, line 18
def find_by_service_tag(tag)
  credentials.find_by_service_tag(tag)
end
new(env) click to toggle source
# File lib/cf-app-utils/cf/app/credentials.rb, line 38
def initialize(env)
  @locator = Service.new(env)
end

Private Class Methods

credentials() click to toggle source
# File lib/cf-app-utils/cf/app/credentials.rb, line 32
def credentials
  Credentials.new(ENV)
end

Public Instance Methods

find_all_by_all_service_tags(tags) click to toggle source

Returns credentials for the service instances with all the given tags.

# File lib/cf-app-utils/cf/app/credentials.rb, line 62
def find_all_by_all_service_tags(tags)
  return [] if tags.empty?

  locator.find_all_by_tags(tags).map { |service| service['credentials'] }
end
find_all_by_service_label(label) click to toggle source

Returns credentials for all service instances with the given label.

# File lib/cf-app-utils/cf/app/credentials.rb, line 75
def find_all_by_service_label(label)
  services = locator.find_all_by_label(label)
  services.map do |service|
    service['credentials']
  end
end
find_all_by_service_tag(tag) click to toggle source
# File lib/cf-app-utils/cf/app/credentials.rb, line 54
def find_all_by_service_tag(tag)
  services = locator.find_all_by_tag(tag)
  services.map do |service|
    service['credentials']
  end
end
find_by_service_label(label) click to toggle source

Returns credentials for the first service instance with the given label.

# File lib/cf-app-utils/cf/app/credentials.rb, line 69
def find_by_service_label(label)
  service = locator.find_by_label(label)
  service['credentials'] if service
end
find_by_service_name(name) click to toggle source

Returns credentials for the service instance with the given name.

# File lib/cf-app-utils/cf/app/credentials.rb, line 43
def find_by_service_name(name)
  service = locator.find_by_name(name)
  service['credentials'] if service
end
find_by_service_tag(tag) click to toggle source

Returns credentials for the first service instance with the given tag.

# File lib/cf-app-utils/cf/app/credentials.rb, line 49
def find_by_service_tag(tag)
  service = locator.find_by_tag(tag)
  service['credentials'] if service
end