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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98ce8b39ef5d2c2a6deb2fb2d2de1f78b9887b87
4
- data.tar.gz: d0af05db892f0386c4bde350ecd6553f0b8a34ff
3
+ metadata.gz: 5f752e26648746f97cbda877656fe901bb993129
4
+ data.tar.gz: 17d9a759004014fea213b131b06c7938c431f382
5
5
  SHA512:
6
- metadata.gz: 2b10a928c2b8db0fb1f5448ad8798ee0249699fed46f5e40266ff6e0359d2ae08cd34acdeabd97801ed65fc70c983fbc749146a97ece788c934d605e98b7ac6d
7
- data.tar.gz: 2936381a3aae7e0c7bc5fff1be2b8a8082764e3f92a2c9f308a66cab849c75332283836d110843c660aebf61b31b438e83ae37f9ef7c9b29fb42dd1c1afd415c
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
- def images
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
 
@@ -1,3 +1,3 @@
1
1
  module Readypulse
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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 = double(Image)
11
+ image = Image.new(raw_image: {})
12
12
  allow(Image).to receive(:new).and_return(image)
13
13
  end
14
14
 
15
- it 'has image_type objects' do
16
- expect(image_collection).to have(3).images
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readypulse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Metcalf