lib/cfoundry/v2/app.rb in cfoundry-0.3.26 vs lib/cfoundry/v2/app.rb in cfoundry-0.3.27
- old
+ new
@@ -27,10 +27,11 @@
attribute :instances, :integer, :default => 1
attribute :file_descriptors, :integer, :default => 256
attribute :disk_quota, :integer, :default => 256
attribute :state, :integer, :default => "STOPPED"
to_many :service_bindings
+ to_many :routes
alias :total_instances :instances
alias :total_instances= :instances=
private :environment_json, :environment_json=
@@ -61,16 +62,18 @@
def console # TODO v2
nil
end
- def uris # TODO v2
- []
+ def uris
+ routes.collect do |r|
+ "#{r.host}.#{r.domain.name}"
+ end
end
alias :urls :uris
def uris=(x)
- nil
+ raise "App#uris= is invalid against V2 APIs. Use add/remove_route."
end
alias :urls= :uris=
def uri
uris[0]