Class: DevRuby::Resources::TagsResource

Inherits:
BaseResource show all
Defined in:
lib/dev_ruby/resources/tags_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/tags_resource.rb', line 6

def all(**params)
  params = to_default_pagination_params(params)

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

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

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

#followed_tags(**params) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dev_ruby/resources/tags_resource.rb', line 22

def followed_tags(**params)
  params = to_default_pagination_params(params)

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

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

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