Class: Shared::Collection Abstract
- Defined in:
- lib/vas/shared/collection.rb
Overview
This class is abstract.
A dynamic collection of items
Direct Known Subclasses
Gemfire::AgentLiveConfigurations, Gemfire::CacheServerLiveConfigurations, Gemfire::LiveApplicationCodes, Gemfire::LocatorLiveConfigurations, Gemfire::Nodes, RabbitMq::LiveConfigurations, RabbitMq::Nodes, MutableCollection, NodeInstances, TcServer::LiveConfigurations, TcServer::NodeApplications, TcServer::NodeRevisions, TcServer::Nodes
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#each {|item| ... } ⇒ void
Gets the items in the collection from the server.
-
#initialize(location, client, type, entry_class) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(location, client, type, entry_class) ⇒ Collection
Returns a new instance of Collection.
29 30 31 32 33 |
# File 'lib/vas/shared/collection.rb', line 29 def initialize(location, client, type, entry_class) super(location, client) @type = type @entry_class = entry_class end |
Instance Method Details
#each {|item| ... } ⇒ void
This method returns an undefined value.
Gets the items in the collection from the server. Calls the block once for each item.
40 41 42 43 44 45 46 47 48 |
# File 'lib/vas/shared/collection.rb', line 40 def each items = client.get(location)[@type] if (!items.nil?) client.get(location)[@type].each { |item| yield entry_class.new(Util::LinkUtils.get_self_link_href(item), client) } end end |