Skip to content

Commit bdfb768

Browse files
authored
Merge pull request #14 from ZarakiLancelot/zarakilancelot
Reto #00-Ruby
2 parents 31e2d93 + 80a5154 commit bdfb768

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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}!"

0 commit comments

Comments
 (0)