SlideShare a Scribd company logo
1 of 14
Download to read offline
Ruby великолепный
RubyWay
Ruby великолепный
2.0.0-p247> parents = [:mom, 'dad',
"grandmom"]
=> [:mom, "dad", "grandmom"]
2.0.0-p247> puts parents[0]
mom
2.0.0-p247> puts parents.first
mom
2.0.0-p247> puts parents.last
grandmom
2.0.0-p247> parents.each do |parent|
2.0.0-p247>

puts parent if parent.present?

2.0.0-p247> end
mom
dad
grandmom

> 5.times {
>

for (int = 5; i < 5; i++){

a = a + 1

> }
=> 5

a = a + 1
}
Миксины
module A
def self.example
:a
end
end
module B
def self.example
:b
end
end
Кто последний, тот и папа :)
module C
include A
def self.example
:c
end
include B
end

C.example
=> :a
C.example
=> :c
C.example
=> :b
Как прострелить соседу
ногу в 5 строк?
class String
def empty?
[true, false].sample
end
end
DSL
Configus.build :development do
env :production do
website_url 'http://example.com'
email do
pop do
address 'pop.example.com'
port

110

end
end
end
end
configus.email.pop.port # => 110
Расширения языка (gems)
2.0.0-p247 :020 > date = Date.current
=> Mon, 04 Nov 2013
2.0.0-p247 :021
=> Tue, 04 Nov
2.0.0-p247 :022
=> Tue, 04 Nov

> date.years_ago(10)
2003
> date + 1.year
2014

2.0.0-p247 :024 > date + 5.years - 1.day
=> Tue, 05 Nov 2018
Ruby великолепный
Инфраструктура
Почему руби программисты спят
спокойно?
● airbrake.io
● errbit
Html? Не, не слышал.
<div>
<h1>Simple table</h1>
<table>
<tr>
<td>
1
</td>
<td>
2
</td>
</tr>
</table
</div>

%div
%h1 Simple table
%table
%tr
%td
1
%td
2
Codeclimat
Rubygems
● 65,327 gems
● 2,258,366,587 downloads
● opensource
На сегодня все ;)
Оставьте свое мнение о курсе:
https://www.facebook.com/undevschool

Андрей Суббота

Вагин Александр

@numbata

@plugin73

More Related Content

Viewers also liked

Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
Vanda Erwan
 
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICSTEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
Assumpció Granero
 
Karl marks theory of socialism
Karl marks theory of socialismKarl marks theory of socialism
Karl marks theory of socialism
Madeha Arif
 

Viewers also liked (15)

MAQUIAGEM BELLA OGGI
MAQUIAGEM BELLA OGGIMAQUIAGEM BELLA OGGI
MAQUIAGEM BELLA OGGI
 
Roteiro blog semana 4e5
Roteiro blog   semana 4e5Roteiro blog   semana 4e5
Roteiro blog semana 4e5
 
Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
Imamkepadarasul rasulallahiswanrahman-130501034646-phpapp02
 
Computer
Computer Computer
Computer
 
Reproducibility with Checkpoint & RRO
Reproducibility with Checkpoint & RROReproducibility with Checkpoint & RRO
Reproducibility with Checkpoint & RRO
 
Programa curricular nivel Preescolar
Programa curricular nivel PreescolarPrograma curricular nivel Preescolar
Programa curricular nivel Preescolar
 
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICSTEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
TEMA 3.B. DESCOBRIMENTS GEOGRÀFICS
 
Karl marks theory of socialism
Karl marks theory of socialismKarl marks theory of socialism
Karl marks theory of socialism
 
Plcc
PlccPlcc
Plcc
 
Epi e epc
Epi e epcEpi e epc
Epi e epc
 
Viering met Sint Maarten (32ste zondag door het jaar C)
Viering met Sint Maarten (32ste zondag door het jaar C)Viering met Sint Maarten (32ste zondag door het jaar C)
Viering met Sint Maarten (32ste zondag door het jaar C)
 
Zacheus (31ste zondag door het jaar C)
Zacheus (31ste zondag door het jaar C)Zacheus (31ste zondag door het jaar C)
Zacheus (31ste zondag door het jaar C)
 
Symposium tourisme nordique, Jean-Michel Perron, PAR Conseils, nov. 2013
Symposium tourisme nordique, Jean-Michel Perron, PAR Conseils, nov. 2013Symposium tourisme nordique, Jean-Michel Perron, PAR Conseils, nov. 2013
Symposium tourisme nordique, Jean-Michel Perron, PAR Conseils, nov. 2013
 
Herramientas sincronicas upata 2013
Herramientas sincronicas upata 2013Herramientas sincronicas upata 2013
Herramientas sincronicas upata 2013
 
Fisiologia renal. parte i
Fisiologia renal. parte iFisiologia renal. parte i
Fisiologia renal. parte i
 

2. ruby великолепный. ruby way