Class: Lingo::Web
Constant Summary collapse
- LINGO =
Hash.nest { |k| Lingo.call(cfg, ['-l', k]) }
Instance Method Summary collapse
Methods inherited from App
init_app, parse_options, rackup, #to_json
Instance Method Details
#doit ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/lingo/web.rb', line 106 def doit @r = LINGO[@l].talk(@q) { |_| _ } if @q && !@q.empty? case params[:f] when 'json' to_json(@q, @r) when 'text' @r && @r.join("\n") else @r &&= @r.join("\n") erb :index end end |