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
+271
@@ -0,0 +1,271 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<title>class Card - RDoc Documentation</title>
|
||||
|
||||
<meta name="keywords" content="ruby,class,Card">
|
||||
|
||||
<meta name="description" content="class Card: Représente une carte à jouer avec sa valeur et sa couleur.">
|
||||
|
||||
|
||||
<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-strength">strength</a></li>
|
||||
<li ><a href="#method-i-to_s">to_s</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-Card">
|
||||
|
||||
|
||||
|
||||
<h1 id="class-Card" class="anchor-link class">
|
||||
class Card
|
||||
</h1>
|
||||
|
||||
<section class="description">
|
||||
|
||||
<p>Représente une carte à jouer avec sa valeur et sa couleur.</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-suit" class="method-detail anchor-link">
|
||||
<div class="method-heading attribute-method-heading">
|
||||
<a href="#attribute-i-suit" title="Link to this attribute">
|
||||
<span class="method-name">suit</span>
|
||||
<span class="attribute-access-type">[R]</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="attribute-i-value" class="method-detail anchor-link">
|
||||
<div class="method-heading attribute-method-heading">
|
||||
<a href="#attribute-i-value" title="Link to this attribute">
|
||||
<span class="method-name">value</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">(value, suit)</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/card.rb, line 5</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">suit</span>)
|
||||
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
|
||||
<span class="ruby-ivar">@suit</span> = <span class="ruby-identifier">suit</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-strength" class="method-detail anchor-link ">
|
||||
<div class="method-header">
|
||||
<div class="method-heading">
|
||||
<a href="#method-i-strength" title="Link to this method">
|
||||
<span class="method-name">strength</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="strength-source">
|
||||
<pre><span class="ruby-comment"># File lib/card.rb, line 16</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">strength</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@value</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-regexp">/\A\d+\z/</span>)
|
||||
<span class="ruby-ivar">@value</span>.<span class="ruby-identifier">to_i</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">case</span> <span class="ruby-ivar">@value</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"ace"</span>
|
||||
<span class="ruby-value">11</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"jack"</span>
|
||||
<span class="ruby-value">12</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"queen"</span>
|
||||
<span class="ruby-value">13</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"king"</span>
|
||||
<span class="ruby-value">14</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
<p>Retourne la force de la carte sous forme d’integer.</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-i-to_s" class="method-detail anchor-link ">
|
||||
<div class="method-header">
|
||||
<div class="method-heading">
|
||||
<a href="#method-i-to_s" title="Link to this method">
|
||||
<span class="method-name">to_s</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="to_s-source">
|
||||
<pre><span class="ruby-comment"># File lib/card.rb, line 11</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
||||
<span class="ruby-node">"#{@value} of #{@suit}"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
<p>Retourne une représentation de la carte sous forme de string.</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
|
||||
Reference in new issue
Block a user