Class: KuportView

Inherits:
Kuport show all
Defined in:
lib/kuport/view.rb

Overview

TODO

Constant Summary

Constants inherited from Kuport

Kuport::VERSION

Instance Method Summary collapse

Methods inherited from Kuport

#agent, #cookies_clear, #cookies_load, #cookies_save, #download_file, #download_with_json, filter, #find_links, #get_module, #initialize, #loggedin?, #login, #login_cookie, #login_passwd, #materials, #menu_links, #messages, #messages_backno, #messages_read, module_url, parse, #timetable

Methods included from Kuport::Helper

#clear_proxy_env_var, #color_str, #escape_filename, #get_page_doc, #get_proxy_env_var, #input_num, #input_passwd, #parse_proxy_str, #quit, #to_abs_url

Constructor Details

This class inherits a constructor from Kuport

Instance Method Details

#select_menuObject



9
10
11
12
13
# File 'lib/kuport/view.rb', line 9

def select_menu
  show_menu
  num = input_num("[0..#{@@menu_items.size-1}]> ")
  send(menu[num]) rescue nil
end

#show_menuObject



3
4
5
6
7
# File 'lib/kuport/view.rb', line 3

def show_menu
  @@menu_items.each_with_index do |(key,value), i|
    print "%1d %s\n" % [i, value]
  end
end

#show_messagesObject



15
16
17
18
19
# File 'lib/kuport/view.rb', line 15

def show_messages
  messages.each_with_index do |mes, i|
    print "%3d %s\n" % [i, mes]
  end
end