fathom_api 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: 2b56f8631f9278d0a5e8631b168d07b807ef191896284e69711fac634da46efe
4
- data.tar.gz: c66e9928e9c6ebff67d46fbe7479220bdbf13489a070c9e390a6f096294a3782
3
+ metadata.gz: 2135fbb0e65011d59344ea4ade4ffc075b2b15611965011d5e5c2c8e08e7d111
4
+ data.tar.gz: 22eef7800e0b45c7f38514bdd11ea11e9f73fc3cdf2b8e683cf60fa4b54384e1
5
5
  SHA512:
6
- metadata.gz: 3b0bb564ab470ae7e84af648dfd9d16ba792bee3366e54dd1ea4308d30b0457c6e46967fafcd3fe03af8ab5f04c7dd0a59936eec8f24bc853904e0b2b8511e20
7
- data.tar.gz: be65304241b52804ed71a5830a75d06aa6be83a0d9015a1d4ccc04ad24de4977ff5058cee0db14b6b6b588a025f72d2499291f097aa923bed95b5d3e1438b3db
6
+ metadata.gz: 5ae5a4867c8039e5d636d98908d6e53238ec32c8ebc3d7729f59fde6fa83a7d4a7e2e2c860027ea8f56bad26f2ed848347ed65c1e757158831543d7f09c121ce
7
+ data.tar.gz: c3519d4925bc3764670d96297008615c5cd7cef8b1b3a80617290917a418dc39e03aa3c06a7e9abf9f495223ec9dbf23355e2057f52baa6b040051805171a909
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fathom_api (0.1.0)
4
+ fathom_api (0.1.1)
5
5
  faraday (~> 1.7)
6
6
  faraday_middleware (~> 1.1)
7
7
 
data/README.md CHANGED
@@ -1,5 +1,3 @@
1
- ### Hello there! This gem is a placeholder and will be updated and working soon. Please do not install it yet.
2
-
3
1
  # Fathom API
4
2
 
5
3
  ### 🛠 An easy to use client with the Fathom API
@@ -49,21 +47,24 @@ response.email
49
47
  # => "you@starfleet.org"
50
48
  ```
51
49
 
52
- ### A note on Fathom::List objects
50
+ ### Pagination
53
51
 
54
52
  When an API's response comes back with a object of "list", we automatically wrap that to attempt to provide some helper methods to ease your implementations.
55
53
 
56
54
  ```ruby
57
- list = client.sites.list
55
+ list = client.sites.list(limit: 1)
58
56
  # => Fathom::List
59
57
 
60
- # get the cursor you can pass to the next request's starting_after param
61
- list.next_page
62
- # or get the ending_before param's cursor
63
- list.prev_page
58
+ # We provide two helper methods to allow you to get the first or last id from the data response
59
+ list.first_id
60
+ list.last_id
64
61
 
65
62
  # check if the list has more after it with
66
63
  list.has_more?
64
+ # => true
65
+
66
+ # use the next page cursor in your next response
67
+ list2 = client.sites.list(limit: 1, starting_after: list.last_id)
67
68
  ```
68
69
 
69
70
  ### Sites
@@ -11,11 +11,11 @@ module Fathom
11
11
  @attributes["has_more"]
12
12
  end
13
13
 
14
- def next_page
14
+ def last_id
15
15
  @attributes["data"].last.id
16
16
  end
17
17
 
18
- def prev_page
18
+ def first_id
19
19
  @attributes["data"].first.id
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fathom
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fathom_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera