Class: App
- Inherits:
-
Object
- Object
- App
- Defined in:
- bin/ifin24
Instance Method Summary collapse
-
#initialize(arguments) ⇒ App
constructor
A new instance of App.
- #run ⇒ Object
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
#run ⇒ Object
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 config = Configuration.instance login = @options.login || config[:login] password = @options.password || config[:password] begin client = Client.new(login, password) client.login or raise LoginError console = Console.new(client) console. rescue LoginError puts "Zły login lub hasło." login = ask('Login: ') password = ask('Password: ') do |q| q.echo = '*' end retry end end |