Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Created August 5, 2013 23:30
Show Gist options
  • Save marciojrtorres/6160610 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6160610 to your computer and use it in GitHub Desktop.
Padrão de nomes usado na linguagem Ruby
class Documento
attr_accessor :titulo, :conteudo ### declaração de atributos
### métodos escritos em minúsculas com underline e,
### quando boleanos, terminam com "?"
def sem_titulo?
return @titulo.nil? || @titulo.empty?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment