valorant 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6b02dcc5bada5f9e14dcf5e7c2b4a4e3dfebd62e733a74ef343d51eb7024829
4
- data.tar.gz: 8a8ea52fff1028a4e9d8bee3f3292a032c448aed75ec2cf39d18516884ad7cda
3
+ metadata.gz: af83d2af3234b500b0ee1f3473619b5362d290fbcf4c6712baf5051af1b7a8c6
4
+ data.tar.gz: e1d40bfaacc474da3eab78f992e4a7c07dda199567c179b4fa2665919eae6515
5
5
  SHA512:
6
- metadata.gz: 867981bdb05ded4140216a83c9f49975ec1a5d403e8cd0b04467ea4abf9ca0b0f3c2bfd22941fb84b34a769c63042094663ff4de90313a7baa4238e6bd4f9aa2
7
- data.tar.gz: 2ab91164dd128aac7d4025b33308bdcc8fc26b94a186c3fa1727f50e150fd1a9f8887c1a3881b5a25fedd5efd7cea8480947492783ee990af999406e06172b86
6
+ metadata.gz: be21b3466f2d24ce812b2fe17ab62f7901b43ba21d971d13b1511ef3609b81495df78d095570e07d1c091c4a0e3350948bd22c9f053baf783674bf6a8f6f9391
7
+ data.tar.gz: 77800ac5facd18a081a35e764b5b776424b5f435b78b51b6567525163076b9e66ba2394a8eab9c3dd44ab3451a540b5d204916b5da02caa5276ce52be5d04d08
data/CHANGELOG.md CHANGED
@@ -1,11 +1,11 @@
1
- ## [Unreleased]
1
+ ## [0.1.2] - 2022-11-21
2
2
 
3
- ## [0.1.0] - 2022-11-16
3
+ - Minor bug fixes and improvements
4
4
 
5
- - Initial release
5
+ ## [0.1.3] - 2022-11-21
6
6
 
7
- ## [Unreleased]
7
+ - Minor bug fixes and improvements
8
8
 
9
- ## [0.1.1] - 2022-11-21
9
+ ## [0.1.4] - 2022-11-27
10
10
 
11
- - Added spec files for all utilities in the valorant module.
11
+ - Added ".accuracy" method
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- valorant (0.1.3)
4
+ valorant (0.1.4)
5
5
  fast_jsonparser
6
6
  rest-client
7
7
 
@@ -33,6 +33,11 @@ class Match
33
33
  @blue_team.max_by(&:score)
34
34
  end
35
35
 
36
+ def accuracy(name, tag)
37
+ player = @all_players.select { |player| player.name.gsub(' ', '') == name.gsub(' ', '') && player.tag == tag }
38
+ [player[0].headshots, player[0].bodyshots, player[0].legshots]
39
+ end
40
+
36
41
  def fetch_game_info
37
42
  @game_version = @meta_data['game_version']
38
43
  @game_start_patched = @meta_data['game_start_patched']
@@ -10,6 +10,22 @@ class MatcheshHistory
10
10
  @matches = fetch_matches(hash['data'])
11
11
  end
12
12
 
13
+ def accuracy(name, tag)
14
+ body_shots = 0
15
+ head_shots = 0
16
+ leg_shots = 0
17
+
18
+ @matches.each do |match|
19
+ headshots, bodyshots, legshots = match.accuracy(name, tag)
20
+
21
+ head_shots += headshots
22
+ body_shots += bodyshots
23
+ leg_shots += legshots
24
+ end
25
+
26
+ [head_shots, body_shots, leg_shots]
27
+ end
28
+
13
29
  private
14
30
 
15
31
  def fetch_matches(matches_json)
@@ -26,6 +26,10 @@ class Player
26
26
  (@kills.to_f / @deaths).round(2)
27
27
  end
28
28
 
29
+ def accuracy
30
+ [@headshots, @bodyshots, @legshots]
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def fetch_general_data
data/lib/api/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Valorant
4
4
  class Api
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valorant
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
  - Gerard Hernandez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-26 00:00:00.000000000 Z
11
+ date: 2022-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_jsonparser