class Lingo::Web

Constants

L
LINGO

Public Instance Methods

doit() click to toggle source
# File lib/lingo/web.rb, line 105
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
t(*t) click to toggle source
# File lib/lingo/web.rb, line 100
def t(*t)
  (i = HL.index(@hl)) && t[i] || t.first
end
url_for(path) click to toggle source
# File lib/lingo/web.rb, line 96
def url_for(path)
  "#{request.script_name}#{path}"
end