Ajoute les commentaires et la documentation RDoc
This commit is contained in:
1 parent
5cf2d683e7
commit
dbd8c51412
56 files changed
+3601
-17
No files matched your search
+253
@@ -0,0 +1,253 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<title>class Deck - RDoc Documentation</title>
|
||||
|
||||
<meta name="keywords" content="ruby,class,Deck">
|
||||
|
||||
<meta name="description" content="class Deck: Représente un paquet de cartes et gère son contenu.">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var rdoc_rel_prefix = "./";
|
||||
var index_rel_prefix = "./";
|
||||
</script>
|
||||
|
||||
<script src="./js/navigation.js" defer></script>
|
||||
<script src="./js/search.js" defer></script>
|
||||
<script src="./js/search_index.js" defer></script>
|
||||
<script src="./js/searcher.js" defer></script>
|
||||
<script src="./js/darkfish.js" defer></script>
|
||||
|
||||
<link href="./css/fonts.css" rel="stylesheet">
|
||||
<link href="./css/rdoc.css" rel="stylesheet">
|
||||
|
||||
|
||||
<body id="top" role="document" class="class">
|
||||
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
|
||||
<span aria-hidden="true">☰</span>
|
||||
</div>
|
||||
|
||||
|
||||
<nav id="navigation" role="navigation">
|
||||
<div id="project-navigation">
|
||||
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
||||
<h2>
|
||||
<a href="./index.html" rel="home">Home</a>
|
||||
</h2>
|
||||
|
||||
<div id="table-of-contents-navigation">
|
||||
<a href="./table_of_contents.html#pages">Pages</a>
|
||||
<a href="./table_of_contents.html#classes">Classes</a>
|
||||
<a href="./table_of_contents.html#methods">Methods</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-section" role="search" class="project-section initially-hidden">
|
||||
<form action="#" method="get" accept-charset="utf-8">
|
||||
<div id="search-field-wrapper">
|
||||
<input id="search-field" role="combobox" aria-label="Search"
|
||||
aria-autocomplete="list" aria-controls="search-results"
|
||||
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
||||
title="Type to search, Up and Down to navigate, Enter to load">
|
||||
</div>
|
||||
|
||||
<ul id="search-results" aria-label="Search Results"
|
||||
aria-busy="false" aria-expanded="false"
|
||||
aria-atomic="false" class="initially-hidden"></ul>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="parent-class-section" class="nav-section">
|
||||
<h3>Ancestors</h3>
|
||||
<ul><li>Object</li></ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="nav-section">
|
||||
<h3>Class Methods</h3>
|
||||
<ul class="link-list" role="directory">
|
||||
<li ><a href="#method-c-new">new</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="nav-section">
|
||||
<h3>Instance Methods</h3>
|
||||
<ul class="link-list" role="directory">
|
||||
<li ><a href="#method-i-draw">draw</a></li>
|
||||
<li ><a href="#method-i-shuffle">shuffle</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer id="validator-badges" role="contentinfo">
|
||||
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
||||
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.14.0.
|
||||
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
||||
</footer>
|
||||
|
||||
</nav>
|
||||
|
||||
<main role="main" aria-labelledby="class-Deck">
|
||||
|
||||
|
||||
|
||||
<h1 id="class-Deck" class="anchor-link class">
|
||||
class Deck
|
||||
</h1>
|
||||
|
||||
<section class="description">
|
||||
|
||||
<p>Représente un paquet de cartes et gère son contenu.</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
||||
|
||||
|
||||
|
||||
<section class="attribute-method-details" class="method-section">
|
||||
<header>
|
||||
<h3>Attributes</h3>
|
||||
</header>
|
||||
|
||||
<div id="attribute-i-cards" class="method-detail anchor-link">
|
||||
<div class="method-heading attribute-method-heading">
|
||||
<a href="#attribute-i-cards" title="Link to this attribute">
|
||||
<span class="method-name">cards</span>
|
||||
<span class="attribute-access-type">[R]</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
|
||||
<header>
|
||||
<h3>Public Class Methods</h3>
|
||||
</header>
|
||||
|
||||
<div id="method-c-new" class="method-detail anchor-link ">
|
||||
<div class="method-header">
|
||||
<div class="method-heading">
|
||||
<a href="#method-c-new" title="Link to this method">
|
||||
<span class="method-name">new</span>
|
||||
<span class="method-args">()</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method-controls">
|
||||
<details class="method-source-toggle">
|
||||
<summary>Source</summary>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<div class="method-source-code" id="new-source">
|
||||
<pre><span class="ruby-comment"># File lib/deck.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
|
||||
<span class="ruby-ivar">@cards</span> = []
|
||||
<span class="ruby-identifier">values</span> = [<span class="ruby-string">"7"</span>, <span class="ruby-string">"8"</span>, <span class="ruby-string">"9"</span>, <span class="ruby-string">"10"</span>, <span class="ruby-string">"ace"</span>, <span class="ruby-string">"jack"</span>, <span class="ruby-string">"queen"</span>, <span class="ruby-string">"king"</span>]
|
||||
<span class="ruby-identifier">suits</span> = [<span class="ruby-string">"hearts"</span>, <span class="ruby-string">"diamonds"</span>, <span class="ruby-string">"clubs"</span>, <span class="ruby-string">"spades"</span>]
|
||||
|
||||
<span class="ruby-identifier">suits</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">suit</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-ivar">@cards</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Card</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">suit</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
||||
<header>
|
||||
<h3>Public Instance Methods</h3>
|
||||
</header>
|
||||
|
||||
<div id="method-i-draw" class="method-detail anchor-link ">
|
||||
<div class="method-header">
|
||||
<div class="method-heading">
|
||||
<a href="#method-i-draw" title="Link to this method">
|
||||
<span class="method-name">draw</span>
|
||||
<span class="method-args">()</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method-controls">
|
||||
<details class="method-source-toggle">
|
||||
<summary>Source</summary>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<div class="method-source-code" id="draw-source">
|
||||
<pre><span class="ruby-comment"># File lib/deck.rb, line 25</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">draw</span>
|
||||
<span class="ruby-ivar">@cards</span>.<span class="ruby-identifier">pop</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
<p>Retire et retourne la dernière carte du paquet.</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-i-shuffle" class="method-detail anchor-link ">
|
||||
<div class="method-header">
|
||||
<div class="method-heading">
|
||||
<a href="#method-i-shuffle" title="Link to this method">
|
||||
<span class="method-name">shuffle</span>
|
||||
<span class="method-args">()</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method-controls">
|
||||
<details class="method-source-toggle">
|
||||
<summary>Source</summary>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<div class="method-source-code" id="shuffle-source">
|
||||
<pre><span class="ruby-comment"># File lib/deck.rb, line 20</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">shuffle</span>
|
||||
<span class="ruby-ivar">@cards</span>.<span class="ruby-identifier">shuffle!</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
<p>Mélange les cartes du paquet.</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
|
||||
Reference in new issue
Block a user