buttercms-ruby 1.5 → 1.6

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
  SHA256:
3
- metadata.gz: 348ca14f5f921c18ed7368f6f49bc97f9649304fa55e64ee1819515060bfbe01
4
- data.tar.gz: 00e814b0baece7fcf1bba2fc29d16ae42c17b47ab32e796b48c249db922357ef
3
+ metadata.gz: 33b36093743686ac542292da5bbf4c0c1c7ade36e9d09c57d72161f8094a722b
4
+ data.tar.gz: d75f6c5f94c7882c8aa105f10d267e78a31f98e660bdc6900827536da4891ce4
5
5
  SHA512:
6
- metadata.gz: 5584f22c5db27a1556bea7370aaf02137b9ffdcf0f613899bad05e85ddfd2795d82ff9f94c0fe1f96b3c2e04dc6659bab08df68e85a80528cfa267307de542b7
7
- data.tar.gz: '0215907376576dc8605406b2983aad57aa3fecdb800e3c291178c94a5cf97f84442236c4138d76c22c0ae088c3ca6e7b2d5a725c73b98f603910a4a7197bc157'
6
+ metadata.gz: da1631dd94328b6c62786002de75bb33de70d4e584bb2f1bd0fb5481847a587a4113cc85d3d19fd69e8ef8a00be25b016c205e4a656c822ffca12140ede8ac34
7
+ data.tar.gz: 8c900e9cc1cfef9eb187e2e5b6b0d1cee3e2dada2ef6c3ba3eff52fb429e07d77660cc29d2ea8a70fdecccc902abcf150b4177c1abf4dfe096a04c52f38840f0
data/README.md CHANGED
@@ -34,7 +34,7 @@ https://buttercms.com/docs/api/?ruby#pages
34
34
 
35
35
 
36
36
  ```ruby
37
- params = {page: 1, page_size: 10, locale: 'en', preview: 1, fields.headline: 'foo bar', levels: 2} # optional
37
+ params = {page: 1, page_size: 10, locale: 'en', preview: 1, 'fields.headline': 'foo bar', levels: 2} # optional
38
38
  pages = ButterCMS::Page.list('news', params)
39
39
  page = ButterCMS::Page.get('news', 'hello-world', params)
40
40
  ```
@@ -45,7 +45,7 @@ https://buttercms.com/docs/api/?ruby#retrieve-a-collection
45
45
 
46
46
  ```ruby
47
47
  # list each instance of a given collection with meta data for fetching the next page.
48
- params = { page: 1, page_size: 10, locale: 'en', preview: 1, fields.headline: 'foo bar', levels: 2 } # optional
48
+ params = { page: 1, page_size: 10, locale: 'en', preview: 1, 'fields.headline': 'foo bar', levels: 2 } # optional
49
49
  ButterCMS::Content.list('collection1', params)
50
50
 
51
51
  # list instances for multiple collections, this will not return meta data for pagination control.
@@ -2,6 +2,7 @@ module ButterCMS
2
2
  class ButterCollection
3
3
  include Enumerable
4
4
 
5
+ attr_reader :items
5
6
  attr_reader :meta
6
7
 
7
8
  def initialize(klass, json)
@@ -18,4 +19,4 @@ module ButterCMS
18
19
  end
19
20
  end
20
21
  end
21
- end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module ButterCMS
2
- VERSION = '1.5'
3
- end
2
+ VERSION = '1.6'
3
+ end
@@ -4,6 +4,12 @@ describe ButterCMS::ButterCollection do
4
4
  let(:json) { {"data" => ["foo"], "meta" => {}} }
5
5
  let(:klass) { double('klass', :new => 'bar') }
6
6
 
7
+ it 'implements #items' do
8
+ collection = ButterCMS::ButterCollection.new(klass, json)
9
+
10
+ expect(collection.items).to match_array(["bar"])
11
+ end
12
+
7
13
  it 'implements #meta' do
8
14
  collection = ButterCMS::ButterCollection.new(klass, json)
9
15
 
@@ -15,4 +21,4 @@ describe ButterCMS::ButterCollection do
15
21
 
16
22
  expect(collection.count).to eq 1
17
23
  end
18
- end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buttercms-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - ButterCMS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec