Class: WCC::Media::Client::Response
- Inherits:
-
AbstractResponse
- Object
- AbstractResponse
- WCC::Media::Client::Response
- Defined in:
- lib/wcc/media/client/response.rb
Instance Method Summary collapse
- #collection_response? ⇒ Boolean
- #count ⇒ Object
- #next_page_query ⇒ Object
- #page_items ⇒ Object
- #skip ⇒ Object
Instance Method Details
#collection_response? ⇒ Boolean
15 16 17 |
# File 'lib/wcc/media/client/response.rb', line 15 def collection_response? body.key?('pagination') end |
#count ⇒ Object
11 12 13 |
# File 'lib/wcc/media/client/response.rb', line 11 def count body.dig('pagination', 'total') end |
#next_page_query ⇒ Object
23 24 25 26 27 |
# File 'lib/wcc/media/client/response.rb', line 23 def next_page_query { offset: page_items.length + skip } end |
#page_items ⇒ Object
19 20 21 |
# File 'lib/wcc/media/client/response.rb', line 19 def page_items body['messages'] || body['series'] || body['speakers'] || body['tags'] || body['streams'] end |
#skip ⇒ Object
7 8 9 |
# File 'lib/wcc/media/client/response.rb', line 7 def skip body.dig('pagination', 'offset') end |