Class: Avmtrf1::Tools::Runner::Forponto
- Inherits:
-
EacRubyUtils::Console::DocoptRunner
- Object
- EacRubyUtils::Console::DocoptRunner
- Avmtrf1::Tools::Runner::Forponto
- Includes:
- EacRubyUtils::Console::Speaker, EacRubyUtils::SimpleCache
- Defined in:
- lib/avmtrf1/tools/runner/forponto.rb,
lib/avmtrf1/tools/runner/forponto/espelho.rb
Defined Under Namespace
Classes: Espelho
Constant Summary collapse
- DEFAULT_VALUES =
{ url: 'http://pontoeletronico.trf1.jus.br/forponto/fptoweb.exe' }.freeze
- DOC =
"Opera\u00E7\u00F5es para Forponto.\n\nUsage:\n __PROGRAM__ [options] __SUBCOMMANDS__\n __PROGRAM__ -h | --help\n\nOptions:\n -h --help Show this screen.\n -u --url=<url> URL inicial.\n -m --matricula=<matricula> Matr\u00EDcula.\n -c --codigo=<codigo> C\u00F3digo.\n"
Instance Method Summary collapse
- #attr_value(name, read_options = {}) ⇒ Object
- #codigo ⇒ Object
- #matricula ⇒ Object
- #run ⇒ Object
- #start_banner ⇒ Object
- #url ⇒ Object
- #user_uncached ⇒ Object
- #value_by_default(name) ⇒ Object
- #value_by_entry(name, read_options) ⇒ Object
- #value_by_option(name) ⇒ Object
Instance Method Details
#attr_value(name, read_options = {}) ⇒ Object
45 46 47 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 45 def attr_value(name, = {}) value_by_option(name) || value_by_default(name) || value_by_entry(name, ) end |
#codigo ⇒ Object
73 74 75 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 73 def codigo attr_value(__method__, noecho: true) end |
#matricula ⇒ Object
69 70 71 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 69 def matricula attr_value(__method__) end |
#run ⇒ Object
35 36 37 38 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 35 def run run_with_subcommand end |
#start_banner ⇒ Object
40 41 42 43 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 40 def infov 'URL', user.url infov 'Matrícula', user.matricula end |
#url ⇒ Object
65 66 67 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 65 def url attr_value(__method__) end |
#user_uncached ⇒ Object
61 62 63 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 61 def user_uncached ::Avmtrf1::Forponto::User.new(url, matricula, codigo) end |
#value_by_default(name) ⇒ Object
53 54 55 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 53 def value_by_default(name) DEFAULT_VALUES[name.to_sym] end |
#value_by_entry(name, read_options) ⇒ Object
57 58 59 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 57 def value_by_entry(name, ) ::Avmtrf1.configs.read_entry("trf1.forponto.#{name}", ) end |
#value_by_option(name) ⇒ Object
49 50 51 |
# File 'lib/avmtrf1/tools/runner/forponto.rb', line 49 def value_by_option(name) .fetch("--#{name}") end |