uclapi 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '049eb318ad9baa6b0be02eb74bcaa63d0ed9b857'
4
- data.tar.gz: 60ef40db39bbe27a2c3140047ecf2af217eba0fb
3
+ metadata.gz: 0aa03362b9e0bec72e46000f42643017610f3124
4
+ data.tar.gz: d8d73dd32432c32f827f3d6cc3e69ea2af535291
5
5
  SHA512:
6
- metadata.gz: 0b5dd6c88238d42f0f3eedd11b06c59f1395a309b769e15c6583d20b3fca3b5b16a02d699396d2a6dbd43238f3cd4a1dbda678dc27010b737a09db80372f0269
7
- data.tar.gz: 6522411b043bc6bc947a9db27c2f750a5de5723db62184bad32c0f6ecc52e080a4285d4762335378c1f892103fd569211025354c27f718d83ff3c878c7b0aa5d
6
+ metadata.gz: aac8fbf80dfcaedda31a7ee0b1c7f3d9f7457178cc08aff27a2646efee225f51428d5797923114d9c732829ae981f9f2e214a1e21f25574b3518dd2204c9432b
7
+ data.tar.gz: e62c4ef574529be2e1e0a1205d33a51d1994322e69ed454cb0cd59b895715ed2241f50900cdce75e04ce4edc84438da24e5b8b843a4639158dab64c905eb57ac
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uclapi (0.2.0)
4
+ uclapi (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -56,6 +56,10 @@ same parameters while automatically setting the `roomid` and `siteid`.
56
56
 
57
57
  Maps to `client.roombookings.room` and passes along the `roomid` and `siteid`.
58
58
 
59
+ ### `booking.next_page`
60
+
61
+ Maps to `client.roombookings.bookings` and passes along the `roomid`, `siteid` and `page_token` to fetch the next page.
62
+
59
63
  ### `equipment.room`
60
64
 
61
65
  Maps to `client.roombookings.room` and passes along the `roomid` and `siteid`.
@@ -122,7 +126,9 @@ UCLAPI::Booking {
122
126
  :weeknumber => 23.0
123
127
  }
124
128
  # optional provide any extra parameters
125
- > rooms = client.roombookings.bookings(siteid: 374)
129
+ > bookings = client.roombookings.bookings(siteid: 374)
130
+ # to fetch the next page, just call next_page on any book
131
+ > next_bookings = bookings.first.next_page
126
132
  ```
127
133
 
128
134
  ### `GET /roombookings/equipment`
@@ -5,4 +5,12 @@ class UCLAPI::Booking < OpenStruct
5
5
  siteid: siteid
6
6
  ).first
7
7
  end
8
+
9
+ def next_page(params = {})
10
+ client.roombookings.bookings(params.merge({
11
+ roomid: roomid,
12
+ siteid: siteid,
13
+ page_token: page_token
14
+ }))
15
+ end
8
16
  end
@@ -11,8 +11,10 @@ class UCLAPI::Client::Roombookings
11
11
  end
12
12
 
13
13
  def bookings(params = {})
14
- @client.get('/roombookings/bookings', params)['bookings'].map do |booking|
14
+ result = @client.get('/roombookings/bookings', params)
15
+ result['bookings'].map do |booking|
15
16
  booking[:client] = @client
17
+ booking[:page_token] = result['page_token']
16
18
  UCLAPI::Booking.new(booking)
17
19
  end
18
20
  end
@@ -1,3 +1,3 @@
1
1
  module UCLAPI
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uclapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristiano Betta