Files
Sightstone/doc/index.html
danijoo 425daf66c1 docs
2013-12-15 02:01:47 +01:00

201 lines
6.4 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
File: README
&mdash; Documentation by YARD 0.8.7.3
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '';
framesUrl = "frames.html#!" + escape(window.location.href);
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> &raquo;
<span class="title">File: README</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><div id='filecontents'>
<h1 id="label-Sightstone">Sightstone</h1>
<p>Sightstone is a ruby wrapper for riots league of legends developer api (<a
href="http://developer.riotgames.com">developer.riotgames.com</a>). Please
not that you need an api key from riot in order to use this gem</p>
<h2 id="label-Installation">Installation</h2>
<p>Just download the gem:
&lt;code&gt;
gem install sightstone
&lt;/code&gt;</p>
<p>If you want to build it by your on, build the gem and install
it:
&lt;code&gt;
cd Sightstone
gem build sightstone.gemspec
gem install
sightstone-x.x.x.gem
&lt;/code&gt;</p>
<h2 id="label-Usage+Examples">Usage Examples</h2>
<p>Sightstone is divided into several modules, each controlled by the base
class &#39;Sightstone&#39;. To use it, simply <code>require
&#39;sightstone&#39;</code></p>
<p>Currently available modules are:
summoner (summoner, runes, masteries),
game, league, stats, champion, teams</p>
<p>Below are usage examples for 2 of the modules. You can review the code to
get an idea about what is currently possible and what isnt. Especially the
module classes under <code>sightstone/modules</code> should be interessting
for that. Working on a wiki begins as soon as i bring myself to comment my
code properly.</p>
<h3 id="label-Summoner">Summoner</h3>
<p>The summoner module handles all calls to the summoner api (summoner, runes,
masteries)</p>
<p>Examples:
```
require &#39;sightstone&#39;
sightstone =
Sightstone.new(&#39;your_api_key&#39;, &#39;na&#39;)</p>
<h1 id="label-gets+the+summoner+by+its+name+OR+id">gets the summoner by its name OR id</h1>
<p>summoner = sightstone.summoner.summoner &#39;dyrus&#39;</p>
<p>summoner.name
=&gt; &quot;Dyrus&quot;
summoner.id
=&gt; 5908
```</p>
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;sightstone&#39;</span>
<span class="ruby-identifier">sightstone</span> = <span class="ruby-constant">Sightstone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;your_api_key&#39;</span>, <span class="ruby-string">&#39;na&#39;</span>)
<span class="ruby-comment"># gets the runebook of the summoner or a summoners id </span>
<span class="ruby-identifier">rune_book</span> = <span class="ruby-identifier">sightstone</span>.<span class="ruby-identifier">summoner</span>.<span class="ruby-identifier">runes</span> <span class="ruby-value">5908</span>
<span class="ruby-identifier">rune_book</span>.<span class="ruby-identifier">pages</span>.<span class="ruby-identifier">size</span>
=<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>
<span class="ruby-identifier">page</span> = <span class="ruby-identifier">rune_book</span>.<span class="ruby-identifier">pages</span>[<span class="ruby-value">0</span>]
<span class="ruby-identifier">page</span>.<span class="ruby-identifier">name</span>
=<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;Jax 2&quot;</span>
<span class="ruby-identifier">page</span>.<span class="ruby-identifier">current</span>
=<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span>
<span class="ruby-identifier">page</span>.<span class="ruby-identifier">slots</span>[<span class="ruby-value">1</span>]
=<span class="ruby-operator">&gt;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-comment">#&lt;Rune:0x007fae98b55c40 @id=5245, @description=&quot;+0.95 attack damage&quot;, @name=&quot;Greater Mark of Attack Damage&quot;, @tier=3&gt;</span>
</pre>
<h3 id="label-Game">Game</h3>
<p>This module handles calls to the game api (used to receive summoners match
history)</p>
<p>Example:
```
require &#39;sightstone&#39;
sightstone =
Sightstone.new(&#39;your_api_key&#39;, &#39;na&#39;)</p>
<p>summoner dyrus = sightstone.summoner.summoner(“Dyrus”)
history =
sightstone.game.recent(dyrus)</p>
<p>history.games.size
=&gt; 10</p>
<p>game = <a href="http://0">history.games</a>
game.gameType
=&gt;
&quot;MATCHED_GAME&quot;
game.createDate
=&gt; 1386503866142
<a
href="http://1">game.statistics</a>.name
=&gt; &quot;GOLD_EARNED&quot;
<a
href="http://1">game.statistics</a>.value
=&gt; 7948
```</p>
<h2 id="label-TODO">TODO</h2>
<ul><li>
<p>Non-api calls to the datadragon</p>
</li></ul>
<h2 id="label-License">License</h2>
<p>Licensed under the MIT License - Feel free to take on world domination with
it.</p>
<h2 id="label-Feedback">Feedback</h2>
<p>Issues, suggestions, pull requests and whatever Dr. Mundo pleases are
welcome.
If you want to contact me: <strong>danijob88 at
googlemail.com</strong></p>
<p><em>This product is not endorsed, certified or otherwise approved in any
way by Riot Games, Inc. or any of its affiliates.</em></p>
</div></div>
<div id="footer">
Generated on Sun Dec 15 01:56:07 2013 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.3 (ruby-2.0.0).
</div>
</body>
</html>