Created
February 18, 2014 01:08
-
-
Save guivinicius/9062623 to your computer and use it in GitHub Desktop.
Revisions
-
guivinicius created this gist
Feb 18, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ # Eu sou um comentario! # # Muito mais simples para entender depois! # Variaveis # Mais comuns var = "Sou uma variável local!" # @var = [1, "asd", "aaaaaa"] # VAR = 123 # Menos comuns # @@var = "Sou uma variável de classe" # $var = "Sou uma variável global" # Tipos diferentes inteiro = 123 float = 123.90 string = "String" symbol = :text array = [1,2,3,4,5,[19,20],7,8,9,10] hash = { :text => "Muito obrigado", :values => [1,2,3, "aree"] } puts hash[:text] puts hash[:values].join(".") # Como declarar Métodos # Somos um método de instancia # def hello { return "Hello" } def hello return "Hello" end def hello "hello" end # Somos um metodo de classe def self.hello "hello" end # puts hello