- Acesso remoto
This file contains 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
module AuditDecorator | |
def changes_with_associations | |
klass = auditable.class | |
audited_changes.map do |attribute, (from, to)| | |
attribute = attribute.to_s | |
if attribute.ends_with?('_id') | |
results = from_to(attribute, from, to) | |
if results.present? | |
from, to = results | |
attribute = attribute[0..-4] |
This file contains 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
require 'rails_helper' | |
feature 'select2' do | |
scenario 'select2', js: true do | |
5.times { create(:disciplina) } | |
visit new_disciplina_path | |
execute_script("$('.disciplina_pre_requisitos .select2-input').val('ABC')") | |
execute_script("$('.disciplina_pre_requisitos .select2-container').select2('open')") | |
wait_for_ajax | |
find('.select2-results li:first-child').click |
This file contains 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
require 'nsicloudooo' | |
require 'base64' | |
oo = NSICloudooo::Client.new 'http://user:password@host:port' | |
filename = '/home/rodrigo/manual.odt' | |
f = File.open(filename) | |
doc = Base64.encode64(f.read) | |
response = oo.granulate(file: doc, filename: 'manual.odt') | |
key = response['key'] | |
oo.done(key) |
This file contains 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
bin | |
.classpath | |
.project |
This file contains 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
--format nested | |
--color |
Implemente todos os exercícios abaixo em Java e Ruby (exceto quando indicada preferência por uma linguagem específica). Evitem copiar a implementação de uma linguagem para outra; pensem nas possibilidades de cada linguagem.
Todos os exercícios devem ser implementados com testes automatizados, de preferência com TDD.
This file contains 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 Conta | |
def initialize(nome_correntista, numero) | |
@nome_correntista, @numero = nome_correntista, numero | |
@saldo = 0 | |
end | |
attr_reader :saldo, :nome_correntista, :numero | |
def depositar(valor) | |
@saldo += valor |
NewerOlder