Class: App

Inherits:
Object
  • Object
show all
Defined in:
bin/ifin24

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ App

Returns a new instance of App.



22
23
24
25
26
27
28
29
# File 'bin/ifin24', line 22

def initialize(arguments)
  @arguments = arguments

  # Set defaults
  @options = OpenStruct.new
  @options.verbose = false
  @options.quiet = false
end

Instance Method Details

#runObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'bin/ifin24', line 31

def run
  parse_options!

  config = Configuration.instance
   = @options. || config[:login]
  password = @options.password || config[:password]

  begin
    client = Client.new(, password)
    client. or raise LoginError

    console = Console.new(client)
    console.main_menu
  rescue LoginError
    puts "Zły login lub hasło."
    
     = ask('Login: ')
    password = ask('Password: ') do |q|
      q.echo = '*'
    end

    retry
  end
end