Sha256: da37c3a7e30f9ee3fb3c49bf9933479a9937c4d25a4f7ebdbf7496fa07f67d18

Contents?: true

Size: 589 Bytes

Versions: 18

Compression:

Stored size: 589 Bytes

Contents

module WCC
  module Media
    class Client < ::WCC::API::RestClient
      class Response < AbstractResponse
        def skip
          body.dig('pagination', 'offset')
        end

        def count
          body.dig('pagination', 'total')
        end

        def collection_response?
          body.key?('pagination')
        end

        def page_items
          body['messages'] || body['series'] || body['speakers'] || body['tags']
        end

        def next_page_query
          {
            offset: page_items.length + skip,
          }
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
wcc-media-client-0.4.9 lib/wcc/media/client/response.rb
wcc-media-client-0.4.8 lib/wcc/media/client/response.rb
wcc-media-client-0.4.7 lib/wcc/media/client/response.rb
wcc-media-client-0.4.6 lib/wcc/media/client/response.rb
wcc-media-client-0.4.5 lib/wcc/media/client/response.rb
wcc-media-client-0.4.4 lib/wcc/media/client/response.rb
wcc-media-client-0.4.3 lib/wcc/media/client/response.rb
wcc-media-client-0.4.2 lib/wcc/media/client/response.rb
wcc-media-client-0.4.1 lib/wcc/media/client/response.rb
wcc-media-client-0.4.0 lib/wcc/media/client/response.rb
wcc-media-client-0.3.8 lib/wcc/media/client/response.rb
wcc-media-client-0.3.7 lib/wcc/media/client/response.rb
wcc-media-client-0.3.6 lib/wcc/media/client/response.rb
wcc-media-client-0.3.5 lib/wcc/media/client/response.rb
wcc-media-client-0.3.3 lib/wcc/media/client/response.rb
wcc-media-client-0.3.2 lib/wcc/media/client/response.rb
wcc-media-client-0.3.1 lib/wcc/media/client/response.rb
wcc-media-client-0.3.0 lib/wcc/media/client/response.rb