16

Click here to load reader

Introdução ao Ruby

Embed Size (px)

Citation preview

Page 1: Introdução ao Ruby

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

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

Características

• Linguagem dinâmica

• Fortemente tipada

• Totalmente OO

• Simula herança múltipla

• CoC

• DRY

• KISS

Page 4: Introdução ao Ruby

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

Tipos Básicos

• FixNum, BigNum e Float

• String – com ‘ ou “

• Symbol

• Array

• Hash

• Regexp

Page 6: Introdução ao Ruby

Convenções de Código

Page 7: Introdução ao Ruby

Operadores

• +, -, /, *, %, **

• +=, -=, *=, /=

• =~, !~

• ==, !=, <, >, <=, >=, <=>

• &, |, ^, ~

• and, or, not, &&, ||, !

• ?:

• .., ...

Page 8: Introdução ao Ruby

Classes

• Método initialize

• attr_reader

• attr_accessor

Page 9: Introdução ao Ruby

Plugins

• Conhecidos como Gems

• Gerenciador do pacotes

Page 10: Introdução ao Ruby

DEMOS

Page 11: Introdução ao Ruby

Ruby On Rails

Page 12: Introdução ao Ruby

Características

• Framework MVC pra Web

• Composto por várias gems:

– ActiveRecord

– ActiveModel

– ActiveResource

– ActionController

– ActionView

– ActionMailer

Page 13: Introdução ao Ruby

DEMO

Page 14: Introdução ao Ruby

Empresas que usam

• Amazon.com

• BBC

• EA

• NASA

• Oracle

• Cisco

• ThoughtWorks

• Yahoo!

• etc...

Page 15: Introdução ao Ruby

Links

• www.ruby-lang.org/en

• www.rubyonrails.org

• www.akitaonrails.com

• www.37signals.com

Page 16: Introdução ao Ruby

DÚVIDAS??

• Muito obrigado!!

[email protected]

@wevertongomes

facebook.com/wevertongomes

linkedin.com/in/wevertongomes