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 characters
# config/enviroments/development.rb | |
config.action_mailer.preview_path = "#{Rails.root}/app/mailer_previews" | |
# app/mailer_previews/devise_mailer_preview.rb | |
class Devise::MailerPreview < ActionMailer::Preview | |
def confirmation_instructions | |
Devise::Mailer.confirmation_instructions(User.first, {}) | |
end |
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 characters
#encoding: utf-8 | |
require 'capybara' | |
require 'nokogiri' | |
class Area_conhecimento | |
def initialize(titulo, numero) | |
@titulo, @numero = titulo, numero | |
end | |
attr_reader :titulo, :numero | |
end |
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 characters
class Carrinho | |
def initialize | |
@itens = [] | |
end | |
def incluir(produto) | |
@itens << ItemCarrinho.new(produto) | |
end | |
def remover(produto) |
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 characters
class Retangulo | |
def initialize(base, altura) | |
raise(ArgumentError, "lado nao pode ser negativo, 0 ou nulo") unless e_valido?(base) and e_valido?(altura) | |
@base, @altura = base, altura | |
end | |
attr_reader :base, :altura | |
def alterar_base(nova_base) | |
if e_valido?(nova_base) |
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 characters
package exercicio_1; | |
public class Bola { | |
private String cor; | |
public Bola(String cor){ | |
if (cor == null || cor.equals("")) | |
throw new RuntimeException(); | |
this.cor = cor; |
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 characters
def anagrams(s): | |
# Return the list of anagrams for s | |
if s == "": | |
return [s] | |
else: | |
ans = [] |