nationbuilder-rb 1.2.0 → 1.2.1

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: 7f736fe98de0df24dd6a2e38b3d7013ec6d49245
4
- data.tar.gz: fca4e68a8753f003ba0f6815abcf74e9d16c8e7d
3
+ metadata.gz: ed83c1a7ea3f4620237f7e8ac24a6a735f53040c
4
+ data.tar.gz: 9de67b51d069fd267fe51a3eece11b58c7fab9cb
5
5
  SHA512:
6
- metadata.gz: 25aec085a33bab04ce580aa96d6f650893a5d603f87caa46f4b910401559b3d66bc161d71bb56370b9bada6a20be5d11b0f4759a587b9edcc3d6c252eb6f2d8f
7
- data.tar.gz: a958baba40eaefda72a00248ef5d3ada11d9b751763de3a97ad17ef068fe6a21220f7eafdf74007ffca41c105f9bad5fa4a463f15ca1a708fa1a67921708e080
6
+ metadata.gz: 38cc6c6a51d1b5a51b47c87afc334d1fb6d6855df1abbf1280edc7b63ab81c56c4df128ab17927afce489724f82e0868f6fe39c4070732d422ee2e7168cb0610
7
+ data.tar.gz: e8fad6eb21f0662b11c7dbf5dec13166ec7fec1f9f7937bfaa724f4a29a4cffb66e690822340df84009a130b299a879f7e3551b39fe8d86c60a3effb9e5a259b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.2.1
2
+ - Include Paginator class in NationBuilder module
3
+
1
4
  # 1.2.0
2
5
  - Native exception types
3
6
  - [#9] Exponential backoff when encountering rate limit
data/README.md CHANGED
@@ -80,12 +80,12 @@ A call can be paginated by creating a new instance of the `Paginator` class. Thi
80
80
  ```ruby
81
81
  response = client.call(:people, :index)
82
82
 
83
- paginated = Paginator.new(client, response)
83
+ paginated = NationBuilder::Paginator.new(client, response)
84
84
  page1 = paginated
85
85
  page2 = page1.next
86
86
  page3 = page2.next
87
87
  ```
88
- Methods `#next` and `#prev` return the results of the next or previous page of results, nil if none. `#next?` and `#prev?` return the path to the next or prev page, or nil if none. The results of a page can be accessed through `.body` - in the above example, `page1.body` returns the same hash as `response`.
88
+ Methods `#next` and `#prev` return the results of the next or previous page of results, nil if none. `#next?` and `#prev?` alert the caller to whether other pages of results exist. The JSON results of a page can be accessed by calling `#body` on a page: in the above example, `page1.body` returns the same hash as `response`.
89
89
 
90
90
  ## Documentation
91
91
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
@@ -1,4 +1,4 @@
1
- class Paginator
1
+ class NationBuilder::Paginator
2
2
  attr_reader :body
3
3
 
4
4
  def initialize(client, body)
@@ -15,7 +15,7 @@ class Paginator
15
15
  return nil unless send(:"#{page_type}?")
16
16
  path = send(:"#{page_type}?").split('/api/v1').last
17
17
  results = @client.raw_call(path, :get)
18
- return Paginator.new(@client, results)
18
+ return self.class.new(@client, results)
19
19
  end
20
20
  end
21
21
 
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: nationbuilder-rb 1.2.0 ruby lib
5
+ # stub: nationbuilder-rb 1.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nationbuilder-rb"
9
- s.version = "1.2.0"
9
+ s.version = "1.2.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Paginator do
3
+ describe NationBuilder::Paginator do
4
4
 
5
5
  let(:client) do
6
6
  NationBuilder::Client.new('organizeralexandreschmitt',
@@ -14,7 +14,7 @@ describe Paginator do
14
14
 
15
15
  describe '#pagination' do
16
16
  before do
17
- @page1 = Paginator.new(client, response)
17
+ @page1 = NationBuilder::Paginator.new(client, response)
18
18
  @page2 = VCR.use_cassette('paginated_get_page2') { @page1.next }
19
19
  end
20
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nationbuilder-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Huie