README.md in nubank_sdk-0.5.0 vs README.md in nubank_sdk-0.5.1

- old
+ new

@@ -22,10 +22,46 @@ $ gem install nubank_sdk ## Usage -TODO: Write usage instructions here +```ruby +require 'nubank_sdk' + +# instance a nubank account object +user = NubankSdk::User.new(cpf: '12345678909') +password = 'dracarys' +``` + +> First time? +> +> authenticate the account +> +> ```ruby +> # request an email code +> account_email = user.auth.request_email_code(password) +> +> # get the email code from the user +> puts "Enter the code sent to #{account_email}: " +> email_code = gets.chomp +> user.auth.exchange_certs(email_code, password) +> ``` +> +--- +> +> Has a certificate? +> +> generate a access token +> +> ```ruby +> user.auth.authenticate_with_certificate(password) +> ``` + +get the account balance + +```ruby +user.account.balance # => 77.0 +``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.