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.



16
17
18
19
20
21
22
23
# File 'bin/ifin24', line 16

def initialize(arguments)
  @arguments = arguments

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

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'bin/ifin24', line 25

def run
  parse_options

  config = Ifin24::Configuration.instance
   = @options. || config[:login]
  password = @options.password || config[:password]
  client = Ifin24::Client.new(, password)

  if client.logged?
    console = Ifin24::Console.new(client)
    console.main_menu
  else
    puts "Bad login or password."
  end
end