uclapi 0.2.0 → 0.3.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +7 -1
- data/lib/uclapi/booking.rb +8 -0
- data/lib/uclapi/client/roombookings.rb +3 -1
- data/lib/uclapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0aa03362b9e0bec72e46000f42643017610f3124
|
|
4
|
+
data.tar.gz: d8d73dd32432c32f827f3d6cc3e69ea2af535291
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aac8fbf80dfcaedda31a7ee0b1c7f3d9f7457178cc08aff27a2646efee225f51428d5797923114d9c732829ae981f9f2e214a1e21f25574b3518dd2204c9432b
|
|
7
|
+
data.tar.gz: e62c4ef574529be2e1e0a1205d33a51d1994322e69ed454cb0cd59b895715ed2241f50900cdce75e04ce4edc84438da24e5b8b843a4639158dab64c905eb57ac
|
data/Gemfile.lock
CHANGED
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
|
-
>
|
|
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`
|
data/lib/uclapi/booking.rb
CHANGED
|
@@ -11,8 +11,10 @@ class UCLAPI::Client::Roombookings
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def bookings(params = {})
|
|
14
|
-
@client.get('/roombookings/bookings', params)
|
|
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
|
data/lib/uclapi/version.rb
CHANGED