lib/nubank_sdk/credit.rb in nubank_sdk-0.6.1 vs lib/nubank_sdk/credit.rb in nubank_sdk-0.7.0
- old
+ new
@@ -1,8 +1,11 @@
# frozen_string_literal: true
module NubankSdk
+ #
+ # Returns the credit statement
+ #
class Credit
#
# Returns the credit statement
#
# @param [NubankSdk::Client::HTTPS] connection
@@ -21,8 +24,21 @@
response = @connection.get(account_url)
response_hash = Client.get_body(response)
response_hash[:account][:balances]
+ end
+
+ #
+ # Returns the credit feed
+ #
+ # @return [Array<Hash>] the credit feed
+ def feed
+ feed_url = @api_routes.entrypoint(path: :ssl, entrypoint: :feed)
+
+ response = @connection.get(feed_url)
+
+ data = Client.get_body(response)
+ data[:events]
end
end
end