Class: Bt::OutputManager
- Inherits:
-
Object
- Object
- Bt::OutputManager
- Defined in:
- lib/bt/output_manager.rb
Instance Method Summary collapse
- #display_api_error ⇒ Object
- #display_help_and_quit ⇒ Object
- #display_no_internet_error ⇒ Object
- #display_params_error ⇒ Object
- #display_system_error ⇒ Object
- #display_timeout_error ⇒ Object
- #display_version_and_quit ⇒ Object
Instance Method Details
#display_api_error ⇒ Object
47 48 49 50 |
# File 'lib/bt/output_manager.rb', line 47 def display_api_error puts "请检查API KEY是否正确^^" exit end |
#display_help_and_quit ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bt/output_manager.rb', line 4 def display_help_and_quit puts <<-EOS ======= 百度翻译 ====== 用法: bt 'from' 'to' 'text' bt 'text' 例如: bt en zh 'how are you' => '你好吗?' bt '你好吗?' => 'how are you' 选项: -v - 版本 -h - 帮助 EOS exit end |
#display_no_internet_error ⇒ Object
32 33 34 35 |
# File 'lib/bt/output_manager.rb', line 32 def display_no_internet_error puts "出错了,请检查你的网络^^" exit end |
#display_params_error ⇒ Object
52 53 54 55 |
# File 'lib/bt/output_manager.rb', line 52 def display_params_error puts "参数错误~~" exit end |
#display_system_error ⇒ Object
42 43 44 45 |
# File 'lib/bt/output_manager.rb', line 42 def display_system_error puts "糟糕,系统出错咯^^" exit end |
#display_timeout_error ⇒ Object
37 38 39 40 |
# File 'lib/bt/output_manager.rb', line 37 def display_timeout_error puts "糟糕,请求超时咯^^" exit end |