Class: DevRuby::Resources::ReadinglistsResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/dev_ruby/resources/readinglists_resource.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#client

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from DevRuby::Resources::BaseResource

Instance Method Details

#all(**params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dev_ruby/resources/readinglists_resource.rb', line 6

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