1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<!-- THIS DOCUMENT IS PUBLISHED ON https://narkoz.github.io/gitlab -->
# Usage
## ObjectifiedHash
Gitlab returns `Gitlab::ObjectifiedHash` for items, which gives you object-like
access to the parsed JSON response
```rb
user = Gitlab.user
user.email #=> "john@example.com"
```
You can access the original hash by calling `to_h` or `to_hash` on the
`Gitlab::ObjectifiedHash` instance
```rb
user = Gitlab.user
hash = user.to_h
```
## Pagination
Use `page` (page number) and `per_page` (number of results per page) in the
options to paginate collections
```rb
Gitlab.projects(per_page: 5)
```
|