Sha256: 354264a514346c3b8ae6588c3d47b2bd2c8c8d222e4585a78084b4142dbe9544

Contents?: true

Size: 645 Bytes

Versions: 2

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true

module DevRuby
  module Resources
    class ReadinglistsResource < BaseResource
      def all(**params)
        params = to_default_pagination_params(params)

        response = get_request('readinglist', params: params)

        if Helpers.expected_response?(response, 200)
          collection = Collection.from_response(response: response,
                                                type: DevRuby::Objects::Article,
                                                params: params)

          Success(collection)
        else
          Failure(error_parser(response))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dev_ruby-1.0.0 lib/dev_ruby/resources/readinglists_resource.rb
dev_ruby-0.2.0 lib/dev_ruby/resources/readinglists_resource.rb