class GeekDict::CLI

Public Instance Methods

t(word) click to toggle source
# File lib/geekdict/cli.rb, line 12
def t(word)
    GeekDict.debugger options[:debug]
    LocalHistory.save word
    if options[:open]
      page = GeekDict::Youdao.url word
      puts "Open Web page : #{page}"
      `open #{page}`
    else
      result = GeekDict::Youdao.translate word
      output = result.join "\n"
      puts output
      output
    end
end
v() click to toggle source
# File lib/geekdict/cli.rb, line 28
def v()
  puts GeekDict::VERSION
end