dblista 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51c3d13971d2263b0c97cf0e6f51d28ca72a870a67a660a6f63807e10f3caaad
4
- data.tar.gz: 3628e33de56b321182bd41a05ce771515395d76a3c2e8baf3da8828354c3d516
3
+ metadata.gz: f20cf6b8c70ff3aaffe688fd51db2370f13e6407a40ad6e6c0c926c129df9ee4
4
+ data.tar.gz: ccc4a69f0712815b3afdf5cf417ffcd1c3aa5983ce83cc9b2471e0441b3b6b7e
5
5
  SHA512:
6
- metadata.gz: 1cbb274d9b3223729e6dcd67ddbb8017b7ab53f5fcce2404a7255fab2ed5bf9945968169865bd9d1e987f285ae78102721868957d7e992a37f35e2849051489e
7
- data.tar.gz: 59678c99464e688a1d00d85bbe3a47abf7c1a035cf1348adccba684b321e6feddcd16bcb7e478dcac67d9e6e89c3706dbae5313b277ea0373ebd93c8eb5086ba
6
+ metadata.gz: 19af727c3ab021766d7bbf3115756544b6ce7ecf90958d28c3c03fc49a2f6dc323e063e0864916a6431a6fda98f47bb6edad3d49bc48a6de15a7f897ce87cd2d
7
+ data.tar.gz: 5112159c5a572e66e11dba712ae35c9b4f35f86ac588577902dc74f6de66e2aa55ed25840e6b5e00f5f8ee2c71573a080fddc9bb635e2c3f68c7acbff334a0f7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dblista (0.1.3)
4
+ dblista (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'json'
4
4
 
5
- # User client - actions
6
5
  module DBLista::User
6
+ # User client - actions
7
7
  module Actions
8
8
  # Adds bot/server to DBLista
9
9
  #
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ##
4
- # User client - boosting
5
3
  module DBLista::User
4
+ # User client - boosting
6
5
  module Boosting
7
6
  # Boosts selected bot/server
8
7
  #
@@ -4,6 +4,7 @@ require_relative './actions'
4
4
  require_relative './boosting'
5
5
  require_relative './rating'
6
6
  require_relative './voting'
7
+ require_relative './notifications'
7
8
 
8
9
  # User module - client + client modules
9
10
  module DBLista::User
@@ -21,6 +22,7 @@ module DBLista::User
21
22
  include DBLista::User::Actions
22
23
  include DBLista::User::Boosting
23
24
  include DBLista::User::Rating
25
+ include DBLista::User::Notifications
24
26
 
25
27
  # Allowed entity types to use
26
28
  ALLOWED_TYPES = %i[bot server].freeze
@@ -35,11 +37,18 @@ module DBLista::User
35
37
  raise DBLista::Error, DBLista::Errors::INVALID_TOKEN unless me['status'] == 'success'
36
38
  end
37
39
 
38
- # Fetches information about user
40
+ # Fetches information about current user
39
41
  #
40
42
  # @return [Hash] raw data from DBLista
41
43
  def me
42
44
  DBLista._get('/users/me', @token)
43
45
  end
46
+
47
+ # Fetches current user guilds
48
+ #
49
+ # @return [Hash] raw data from DBLista
50
+ def guilds
51
+ DBLista._get('/users/me/guilds', @token)
52
+ end
44
53
  end
45
54
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DBLista::User
4
+ # User client - notifications
5
+ module Notifications
6
+ # Fetches user notifications
7
+ #
8
+ # @return [Hash] raw data from DBLista
9
+ def notifications
10
+ DBLista._get('/users/me/notifications/read', @token)
11
+ end
12
+
13
+ # Clears user notifications
14
+ #
15
+ # @return [Hash] raw data from DBLista
16
+ def clear_notifications
17
+ DBLista._delete('/users/me/notifications/clear', @token)
18
+ end
19
+ end
20
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # User client - rating
4
3
  module DBLista::User
4
+ # User client - rating
5
5
  module Rating
6
6
  # Sends rate for a selected bot/server
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # User client - voting
4
3
  module DBLista::User
4
+ # User client - voting
5
5
  module Voting
6
6
  # Votes for a selected bot/server
7
7
  #
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DBLista
4
4
  # Wrapper version
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblista
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - deepivin
@@ -78,6 +78,7 @@ files:
78
78
  - lib/dblista/user/actions.rb
79
79
  - lib/dblista/user/boosting.rb
80
80
  - lib/dblista/user/client.rb
81
+ - lib/dblista/user/notifications.rb
81
82
  - lib/dblista/user/rating.rb
82
83
  - lib/dblista/user/voting.rb
83
84
  - lib/dblista/version.rb