Method: PTT::UI#initialize
- Defined in:
- lib/ptt/ui.rb
#initialize(args) ⇒ UI
Returns a new instance of UI.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ptt/ui.rb', line 12 def initialize(args) require 'pt/debugger' if ARGV.delete('--debug') @io = HighLine.new @global_config = load_global_config @client = PTT::Client.new(@global_config[:api_number]) @local_config = load_local_config @project = @client.get_project(@local_config[:project_id]) command = args[0].to_sym rescue :my_work @params = args[1..-1] commands.include?(command.to_sym) ? send(command.to_sym) : help end |