lib/nubank_sdk/account.rb in nubank_sdk-0.5.0 vs lib/nubank_sdk/account.rb in nubank_sdk-0.5.1

- old
+ new

@@ -1,12 +1,21 @@ module NubankSdk class Account + # + # Returns the account statement + # + # @param [NubankSdk::Client::HTTPS] connection + # @param [NubankSdk::ApiRoutes] api_routes def initialize(connection:, api_routes:) @connection = connection @api_routes = api_routes end + # + # Returns the account balance + # + # @return [Float] def balance query_url = @api_routes.entrypoint(path: :ssl, entrypoint: :query) response = @connection.post( query_url, { @@ -17,6 +26,6 @@ data = NubankSdk::Client.get_body(response) data[:data][:viewer][:savingsAccount][:currentSavingsBalance][:netAmount] end end -end \ No newline at end of file +end