Introdução ao Ruby
Click here to load reader
-
Upload
weverton-gomes -
Category
Entertainment & Humor
-
view
198 -
download
1
Transcript of Introdução ao Ruby
![Page 1: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/1.jpg)
RubyUma Linguagem Divertida
Weverton Gomes@wevertongomes
facebook.com/wevertongomeslinkedin.com/in/wevertongomes
Tecnólogo em Redes de ComunicaçãoArquiteto de Software na Tron Informática
Desenvolvedor Delphi, C# e RailsEntusiasta de novas tecnologias
![Page 2: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/2.jpg)
História sempre é bom
• Criada em 1993 por Yukihiro Matsumoto (Matz)
• Inspirada em Python, Smalltalk, Eiffel, Ada e Lisp
• Primeira versão liberada em 1995
• Adoção crescente a partir de 2005 com a ascensão do RubyOnRails
![Page 3: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/3.jpg)
Características
• Linguagem dinâmica
• Fortemente tipada
• Totalmente OO
• Simula herança múltipla
• CoC
• DRY
• KISS
![Page 4: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/4.jpg)
Métodos
• Isso não te pertence mais!!
• O esquema agora é mensagem
• Parênteses são opcionais
• Parâmetros opcionais
• E o retorno?
![Page 5: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/5.jpg)
Tipos Básicos
• FixNum, BigNum e Float
• String – com ‘ ou “
• Symbol
• Array
• Hash
• Regexp
![Page 6: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/6.jpg)
Convenções de Código
![Page 7: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/7.jpg)
Operadores
• +, -, /, *, %, **
• +=, -=, *=, /=
• =~, !~
• ==, !=, <, >, <=, >=, <=>
• &, |, ^, ~
• and, or, not, &&, ||, !
• ?:
• .., ...
![Page 8: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/8.jpg)
Classes
• Método initialize
• attr_reader
• attr_accessor
![Page 9: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/9.jpg)
Plugins
• Conhecidos como Gems
• Gerenciador do pacotes
![Page 10: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/10.jpg)
DEMOS
![Page 11: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/11.jpg)
Ruby On Rails
![Page 12: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/12.jpg)
Características
• Framework MVC pra Web
• Composto por várias gems:
– ActiveRecord
– ActiveModel
– ActiveResource
– ActionController
– ActionView
– ActionMailer
![Page 13: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/13.jpg)
DEMO
![Page 14: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/14.jpg)
Empresas que usam
• Amazon.com
• BBC
• EA
• NASA
• Oracle
• Cisco
• ThoughtWorks
• Yahoo!
• etc...
![Page 15: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/15.jpg)
Links
• www.ruby-lang.org/en
• www.rubyonrails.org
• www.akitaonrails.com
• www.37signals.com
![Page 16: Introdução ao Ruby](https://reader038.fdocumentos.tips/reader038/viewer/2022100519/55a1410b1a28abea278b475f/html5/thumbnails/16.jpg)
DÚVIDAS??
• Muito obrigado!!
@wevertongomes
facebook.com/wevertongomes
linkedin.com/in/wevertongomes