Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
RUBY | ||
|
||
Philosophie | ||
- L'homme est le Maitre. La machine est l'esclave. | ||
- POLS : Principle of Least Surprise | ||
|
||
Syntaxe | ||
- Code court, lisible, facile � �crire | ||
- Pas de d�claration des variables | ||
- Parenth�ses et points virgules optionnels | ||
|
||
- Simple � prendre en main venant de : | ||
Shell, PERL, Python, SmallTalk, Lisp, C, C++, Java... | ||
|
||
Conventions | ||
- CONSTANTE (ou Constante) | ||
- Classe | ||
- @@class_var, @property | ||
- methode_question? methode_in_place! | ||
- :symbole | ||
- "chaine interpretee #{variable}" | ||
- 'chaine sans interpretation #{variable}' | ||
- def func(param_optionnel = default_value) | ||
- op�rateurs | ||
- modifieurs (condition postfixe) | ||
|
||
POO | ||
- Tout est objet. Classe de base : Object | ||
- H�ritage simple | ||
class MyString < String | ||
- Modification dynamique du code | ||
class String | ||
def is_long? # j'ajoute une fonctionnalit� | ||
self.length > 8 | ||
end | ||
end | ||
|
||
s = "longue" # je n'ai pas envie de toucher � la classe | ||
def s.is_long? | ||
true | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters