lib/cfoundry/v1/client.rb in cfoundry-0.3.11 vs lib/cfoundry/v1/client.rb in cfoundry-0.3.12
- old
+ new
@@ -73,11 +73,11 @@
@base.system_services.each do |type, vendors|
vendors.each do |vendor, versions|
versions.each do |num, meta|
services <<
- Service.new(vendor.to_s, num, meta[:description], type)
+ Service.new(vendor.to_s, num.to_s, meta[:description], type)
end
end
end
services
@@ -193,17 +193,13 @@
# and retrieval.
def app(name = nil)
App.new(name, self)
end
- # TODO: remove once v2 allows filtering by name
- # see V2::Client#app_by_name
def app_by_name(name)
app = app(name)
- if app.exists?
- app
- end
+ app if app.exists?
end
# Retrieve all of the current user's services.
def service_instances
@base.services.collect do |json|
@@ -216,8 +212,13 @@
#
# This should be used for both service creation (after calling
# Service#create!) and retrieval.
def service_instance(name = nil)
ServiceInstance.new(name, self)
+ end
+
+ def service_instance_by_name(name)
+ service = service_instance(name)
+ service if service.exists?
end
end
end