sc2ranks 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +61 -9
  2. data/VERSION +1 -1
  3. data/sc2ranks.gemspec +1 -1
  4. metadata +3 -3
@@ -4,15 +4,67 @@ A gem used to access the api of http://sc2ranks.com
4
4
 
5
5
  Documentation about the api can be found at http://sc2ranks.com/api
6
6
 
7
- == Contributing to sc2ranks
8
-
9
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
10
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
11
- * Fork the project
12
- * Start a feature/bugfix branch
13
- * Commit and push until you are happy with your contribution
14
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
15
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
7
+ == Starting Out
8
+
9
+ First you need an instance of the Sc2ranks class. Just pass a app key to the new
10
+ method. According to the api page at sc2ranks.com an appkey should be the domain
11
+ that you are requesting from.
12
+
13
+ sc2ranks = Sc2ranks.new('sc2.kelsin.net')
14
+
15
+ == Character data (/w Teams)
16
+
17
+ Right now the only api call implemented is the "Character with base team info"
18
+ call since it handles everything I need currently. Just use the character method
19
+ of the Sc2ranks object with a battle.net profile url:
20
+
21
+ character = sc2ranks.character('http://us.battle.net/sc2/en/profile/280904/1/Kelsin/')
22
+
23
+ This will return an object with the following methods
24
+
25
+ * name:: Character name
26
+ * bnet_id:: Battle.net ID
27
+ * region:: Battle.net region
28
+ * id:: Sc2ranks id
29
+ * updated_at:: When the sc2ranks data was last updated
30
+ * achievement_points:: Current achievement point total
31
+ * character_code:: Character Code (sc2ranks won't have access to these anymore)
32
+ * portrait:: Portrait object with portrait data
33
+ * teams:: An array of Team objects with team data
34
+
35
+ == Portrait Data
36
+
37
+ The portrait object contains the following fields
38
+
39
+ * icon_id:: Which icon graphic to use
40
+ * column:: Which column in the graphic to use
41
+ * row:: Which row in the graphic to use
42
+
43
+ Please see http://sc2ranks.com/api for more information on using this data.
44
+
45
+ == Team Data
46
+
47
+ To get to a certain team quick you can use the team method on your Character
48
+ object
49
+
50
+ character.team(bracket, is_random)
51
+
52
+ Bracket can be 1 through 4. The is_random parameter defaults to false so you
53
+ don't need to use it. Team data does not include team members yet.
54
+
55
+ If you call this with 1 you get the 1v1 team immediately (or nil if it doesn't exist)
56
+
57
+ If you call it with any other parameters you get an array of teams (or [] if
58
+ there are none)
59
+
60
+ # Get 1v1 team
61
+ character.team(1)
62
+
63
+ # Get 2v2 random team
64
+ character.team(2, true)
65
+
66
+ # Get 4v4 teams
67
+ character.team(4)
16
68
 
17
69
  == Copyright
18
70
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sc2ranks}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Christopher Giroir"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sc2ranks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christopher Giroir