readypulse 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/readypulse/image_collection.rb +3 -14
- data/lib/readypulse/version.rb +1 -1
- data/spec/lib/readypulse/image_collection_spec.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f752e26648746f97cbda877656fe901bb993129
|
4
|
+
data.tar.gz: 17d9a759004014fea213b131b06c7938c431f382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e30d09d4606433e0fa4a2069175e350c9d1ae68d413d41f13994e2acf4d97333c369b695f00049696c1a229ff4be0655e30811d3be01ab5d59a87dad64f023f8
|
7
|
+
data.tar.gz: 320d7d21197b0c85f3a80b43765c4e2379cd363fefdc1f533ca03969a0c4ba018724b58a4c03d0f598e9dfe3310bad89e86f02103f02ef1c26010b6be69d2d95
|
@@ -1,30 +1,19 @@
|
|
1
1
|
module Readypulse
|
2
|
-
class ImageCollection
|
2
|
+
class ImageCollection < Array
|
3
3
|
|
4
|
-
include Enumerable
|
5
4
|
attr_accessor :images, :album_id
|
6
5
|
|
7
6
|
def initialize(album_id:)
|
8
7
|
@album_id = album_id
|
9
|
-
end
|
10
|
-
|
11
|
-
def each(&block)
|
12
|
-
images.each(&block)
|
13
|
-
end
|
14
|
-
|
15
|
-
def all
|
16
|
-
images
|
17
|
-
end
|
18
8
|
|
19
|
-
|
20
|
-
@images ||= get_images
|
9
|
+
get_images
|
21
10
|
end
|
22
11
|
|
23
12
|
private
|
24
13
|
|
25
14
|
def get_images
|
26
15
|
from_client.map do |raw_image|
|
27
|
-
Image.new(raw_image: raw_image)
|
16
|
+
self << Image.new(raw_image: raw_image)
|
28
17
|
end
|
29
18
|
end
|
30
19
|
|
data/lib/readypulse/version.rb
CHANGED
@@ -8,12 +8,16 @@ module Readypulse
|
|
8
8
|
allow(Client).to receive(:instance).and_return(client)
|
9
9
|
allow(client).to receive(:to_images).and_return(from_client)
|
10
10
|
|
11
|
-
image =
|
11
|
+
image = Image.new(raw_image: {})
|
12
12
|
allow(Image).to receive(:new).and_return(image)
|
13
13
|
end
|
14
14
|
|
15
|
-
it '
|
16
|
-
expect(image_collection).to have(3).
|
15
|
+
it 'is a collection' do
|
16
|
+
expect(image_collection).to have(3).items
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'contains image objects' do
|
20
|
+
expect(image_collection.sample).to be_a(Image)
|
17
21
|
end
|
18
22
|
|
19
23
|
|