Class: OodAppkit::Clusters
- Inherits:
-
Object
- Object
- OodAppkit::Clusters
- Includes:
- Enumerable
- Defined in:
- lib/ood_appkit/clusters.rb
Overview
An enumerable that holds a list of ClusterDecorator objects
Instance Method Summary collapse
-
#[](id) ⇒ ClusterDecorator?
Find object in list from object’s id.
-
#each {|obj| ... } ⇒ Object
Iterate over each of the clusters.
-
#initialize(clusters = []) ⇒ Clusters
constructor
A new instance of Clusters.
Constructor Details
#initialize(clusters = []) ⇒ Clusters
7 8 9 |
# File 'lib/ood_appkit/clusters.rb', line 7 def initialize(clusters = []) @clusters = clusters end |
Instance Method Details
#[](id) ⇒ ClusterDecorator?
Find object in list from object’s id
14 15 16 |
# File 'lib/ood_appkit/clusters.rb', line 14 def [](id) @clusters.detect { |v| v == id } end |
#each {|obj| ... } ⇒ Object
Iterate over each of the clusters
20 21 22 |
# File 'lib/ood_appkit/clusters.rb', line 20 def each(&block) @clusters.each(&block) end |