Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Rails Bootcamp [Sesión 01]
A. Felipe Cabargas Madrid
April 30, 2016
Programming
0
40
Rails Bootcamp [Sesión 01]
A. Felipe Cabargas Madrid
April 30, 2016
Tweet
Share
More Decks by A. Felipe Cabargas Madrid
See All by A. Felipe Cabargas Madrid
felipecabargas
0
23
felipecabargas
1
41
felipecabargas
0
64
felipecabargas
0
21
felipecabargas
0
43
felipecabargas
0
79
felipecabargas
0
90
felipecabargas
0
62
felipecabargas
1
57
Other Decks in Programming
See All in Programming
masamichi
0
220
rukiadia
1
800
hamakou108
4
490
track3jyo
3
220
ajstarks
2
410
bkuhlmann
4
690
emberconf
0
130
yusuke57
0
120
rockname
1
320
treby
0
110
marcoow
0
160
hr01
0
1.9k
Featured
See All Featured
jmmastey
10
690
davidbonilla
70
3.6k
malarkey
119
16k
chrislema
231
16k
lemiorhan
628
47k
cassininazir
347
20k
rasmusluckow
318
18k
lauravandoore
10
1.7k
chriscoyier
146
20k
sachag
267
17k
smashingmag
283
47k
ufuk
56
5.5k
Transcript
RAILS BOOTCAMP 30 ABRIL 2016
FELIPE CABARGAS M. Service Engineer @ GitLab @juanpintoduran cabargas.com gitlab.com/cabargas
RUBY?
ruby != rails
None
RUBY IS DESIGNED TO MAKE PROGRAMMERS HAPPY ~ MATZ
None
RAILS BOOTCAMP! RUBY? ▸ NO fuertemente tipado. ▸ O.O.P. ▸
Principio de la menor sorpresa. ▸ Soluciones aburridas. ▸ M.I.N.S.W.A.N.: Matz is Nice So We Are Nice
YA PERO… RUBY?
foo este_es_un_identificador
$variable_global
@variable_de_instancia
CONSTANTE
# este es un comentario
=begin esto es documentación multi línea =end
“este es un string” *
“así se reemplazan #{variables}"
puts “String”
self nil true false
array = [1, 2, 3]
hash = {a: 1, b: 2, c: 3}
&& ||
1..20
CICLOS EN RUBY
if condicion then # ordenes elsif # ordenes else #
ordenes end
unless condicion # ordenes else # ordenes end
case variable when rango/valor # ordenes when rango/valor # ordenes
else # ordenes end
while condicion # ordenes end
until condicion # ordenes end
for variable in rango # ordenes end
(1..20).each do |variable| # ordenes end
def nombre_funcion argumentos # ordenes end nombre_funcion(argumentos)
AHORA, COSAS “CHÉVERES”
foo, bar = [1, 2] asignación múltiple
if true then true else false end instrucciones de 1-línea
condicion ? si_se_cumple : si_no_se_cumple instrucciones de 1-línea