Class: CfRubyClient::Space
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
Class Method Summary collapse
Instance Method Summary collapse
- #app_guids ⇒ Object
- #apps ⇒ Object
-
#initialize(guid) ⇒ Space
constructor
A new instance of Space.
Methods inherited from Base
#api_endpoint, #authorization_string, #cloud_foundry_config, #delete_entity, #fetch_entities, #logger, #patch_entity, #post_entity, #put_entity, #resource, #uaa_endpoint
Constructor Details
#initialize(guid) ⇒ Space
Returns a new instance of Space.
11 12 13 |
# File 'lib/cf_ruby_client/space.rb', line 11 def initialize(guid) @guid = guid end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
9 10 11 |
# File 'lib/cf_ruby_client/space.rb', line 9 def guid @guid end |
Class Method Details
.all ⇒ Object
4 5 6 7 |
# File 'lib/cf_ruby_client/space.rb', line 4 def self.all url_path = "/v2/spaces" JSON::parse(CfRubyClient::Base.new.fetch_entities(url_path)) end |
Instance Method Details
#app_guids ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/cf_ruby_client/space.rb', line 20 def app_guids if not(apps.nil? or apps.empty?) apps["resources"].collect {|entry| entry["metadata"]["guid"]} else [] end end |
#apps ⇒ Object
15 16 17 18 |
# File 'lib/cf_ruby_client/space.rb', line 15 def apps url_path = "/v2/spaces/#{guid}/apps" JSON::parse(fetch_entities(url_path)) end |