brawlhalla-api 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +33 -8
- data/lib/brawlhalla/api/client.rb +5 -5
- data/lib/brawlhalla/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cd668d0f4cf56bec429a1953a9a0ebc4907bd4ec7d5b82539cd3d781e2c0d17
|
4
|
+
data.tar.gz: 0321c55a09c7b6ef668642c7553b14178bb0fa5cdbb41697565dc81840263322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 142fadb985dd53d60375c1ba2372df44b54bafabd27e6461faef31e38034a01134224cc90203d9ffd673f9c35c4eaf7e2cddbd7946ba1bf8899bd676b2e97c0d
|
7
|
+
data.tar.gz: 34a49f5f6391dca529be2e57f630b84b3da11f7818cf7f366c4560ced725f7be2a40849f71d025ca7798e127bda05985c3b9fa69cfad21b55022b20abd4cef92
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# Brawlhalla
|
1
|
+
# Brawlhalla API
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
A ruby wrapper for the [Brawlhalla API](http://dev.brawlhalla.com/).
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,17 +20,44 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
### Search By Steam ID
|
24
|
+
|
25
|
+
A Player can be looked up by steam ID. This returns the player’s name and brawlhalla_id.
|
26
|
+
|
27
|
+
_(A player’s steamid in format steamID64 (ex 76561198025185087).)_
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
31
|
+
bh.search('PLAYER_STEAM_ID')
|
32
|
+
```
|
33
|
+
|
34
|
+
### Players
|
35
|
+
|
36
|
+
#### Stats
|
37
|
+
|
38
|
+
This endpoint retrieves all stats about a player
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
42
|
+
bh.stats('PLAYER_BRAWLHALLA_ID')
|
43
|
+
```
|
44
|
+
|
45
|
+
#### Ranked
|
46
|
+
|
47
|
+
This endpoint retrieves ranked data about a player.
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
51
|
+
bh.ranked('PLAYER_BRAWLHALLA_ID')
|
52
|
+
```
|
26
53
|
|
27
54
|
## Development
|
28
55
|
|
29
56
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
57
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
58
|
## Contributing
|
34
59
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rikas/brawlhalla-api.
|
36
61
|
|
37
62
|
## License
|
38
63
|
|
@@ -10,7 +10,7 @@ module Brawlhalla
|
|
10
10
|
# Search player by Steam ID.
|
11
11
|
#
|
12
12
|
# === Example
|
13
|
-
# bh = Brawlhalla::API::Client.new(YOUR_API_KEY_HERE)
|
13
|
+
# bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
14
14
|
# bh.search(76561198048321884)
|
15
15
|
def search(steamid)
|
16
16
|
request(
|
@@ -22,7 +22,7 @@ module Brawlhalla
|
|
22
22
|
# Get player stats by giving the Brawlhalla ID.
|
23
23
|
#
|
24
24
|
# === Example
|
25
|
-
# bh = Brawlhalla::API::Client.new(YOUR_API_KEY_HERE)
|
25
|
+
# bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
26
26
|
# bh.stats(8817417)
|
27
27
|
def stats(brawlhalla_id)
|
28
28
|
request(path: "player/#{brawlhalla_id}/stats")
|
@@ -31,9 +31,9 @@ module Brawlhalla
|
|
31
31
|
# Get player ranked stats by giving the Brawlhalla ID.
|
32
32
|
#
|
33
33
|
# === Example
|
34
|
-
# bh = Brawlhalla::API::Client.new(YOUR_API_KEY_HERE)
|
35
|
-
# bh.
|
36
|
-
def
|
34
|
+
# bh = Brawlhalla::API::Client.new('YOUR_API_KEY_HERE')
|
35
|
+
# bh.ranked(8817417)
|
36
|
+
def ranked(brawlhalla_id)
|
37
37
|
request(path: "player/#{brawlhalla_id}/ranked")
|
38
38
|
end
|
39
39
|
|