File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/ruby Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ # Realizado con https://www.ruby-lang.org/es/
2+ # Comentario de una lína
3+ =begin
4+ Comentario
5+ de varias
6+ líneas
7+ =end
8+
9+ variable = "Una variable"
10+ CONSTANTE = "Una constante"
11+
12+ # En Ruby no hay primitivos, casi todo es un objeto
13+ =begin
14+ Numéricos:
15+ - Integer
16+ - Fixnum
17+ - Bignum
18+ - Float
19+ - Complex
20+ - BigDecimal
21+ - Rational
22+ =end
23+ numero = 1_000
24+
25+ =begin
26+ Texto
27+ =end
28+ cadena_de_texto = "Ruby"
29+
30+ # Arrays
31+ un_array = [ 1 , 2 , 3 ]
32+
33+ # Hash
34+ un_hash = { "uno" => 1 , "dos" => 2 }
35+ otro_hash = { :uno => 1 , :dos => 2 }
36+ otro_hash_mas = { uno : 1 , dos : 2 }
37+
38+ # Range
39+ primera_guerra_mundial = 1914 ..1918 # Entre 1914 y 1918 inclusive
40+ segunda_guerra_mundial = 1939 ...1946 # Entre 1939 y 1946 (se excluye 1946)
41+
42+ # Symbol
43+ simbolo = :simbolo
44+
45+ # Booleans
46+ verdadero = true
47+ falso = false
48+
49+ # Nulo
50+ nulo = nil
51+
52+ puts "¡Hola, #{ cadena_de_texto } !"
You can’t perform that action at this time.
0 commit comments