Class: Maia::FCM::ResultCollection
- Inherits:
-
Object
- Object
- Maia::FCM::ResultCollection
- Includes:
- Enumerable
- Defined in:
- lib/maia/fcm/result_collection.rb
Instance Method Summary collapse
- #<<(result) ⇒ Object
- #[](index) ⇒ Object
- #each(&block) ⇒ Object
- #failed ⇒ Object
-
#initialize(results = []) ⇒ ResultCollection
constructor
A new instance of ResultCollection.
- #succeeded ⇒ Object
- #with_canonical_ids ⇒ Object
Constructor Details
#initialize(results = []) ⇒ ResultCollection
Returns a new instance of ResultCollection.
6 7 8 |
# File 'lib/maia/fcm/result_collection.rb', line 6 def initialize(results = []) @results = results end |
Instance Method Details
#<<(result) ⇒ Object
26 27 28 |
# File 'lib/maia/fcm/result_collection.rb', line 26 def <<(result) @results << result end |
#[](index) ⇒ Object
22 23 24 |
# File 'lib/maia/fcm/result_collection.rb', line 22 def [](index) @results[index] end |
#each(&block) ⇒ Object
30 31 32 |
# File 'lib/maia/fcm/result_collection.rb', line 30 def each(&block) @results.each(&block) end |
#failed ⇒ Object
14 15 16 |
# File 'lib/maia/fcm/result_collection.rb', line 14 def failed @results.select(&:fail?) end |
#succeeded ⇒ Object
10 11 12 |
# File 'lib/maia/fcm/result_collection.rb', line 10 def succeeded @results.select(&:success?) end |
#with_canonical_ids ⇒ Object
18 19 20 |
# File 'lib/maia/fcm/result_collection.rb', line 18 def with_canonical_ids @results.select(&:has_canonical_id?) end |