class Formatafacil::TarefaChooser
Public Instance Methods
escolhe_tarefa()
click to toggle source
# File lib/formatafacil/tarefa_chooser.rb, line 19 def escolhe_tarefa Formatafacil::TarefaModelos.new().modelos_disponiveis.each do |modelo| if existe_arquivo_de_texto?(markdown_file(modelo)) then return Formatafacil::ArtigoTarefa.new(modelo: modelo) else raise ArquivoDeTextoNaoEncontradoException end end end
existe_arquivo_de_texto?(arquivo)
click to toggle source
# File lib/formatafacil/tarefa_chooser.rb, line 33 def existe_arquivo_de_texto?(arquivo) File.exist?(arquivo) end
markdown_file(file)
click to toggle source
# File lib/formatafacil/tarefa_chooser.rb, line 29 def markdown_file(file) "#{file}.md" end