Skip to content
Snippets Groups Projects
Verified Commit fea6ec98 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Make the Api#transaction_id method public

parent 5fb8dae8
No related branches found
No related tags found
No related merge requests found
Pipeline #12175 passed
...@@ -305,6 +305,15 @@ module MatrixSdk ...@@ -305,6 +305,15 @@ module MatrixSdk
end end
end end
# Generate a transaction ID
#
# @return [String] An arbitrary transaction ID
def transaction_id
ret = @transaction_id ||= 0
@transaction_id = @transaction_id.succ
ret
end
private private
def print_http(http, body: true, duration: nil, id: nil) def print_http(http, body: true, duration: nil, id: nil)
...@@ -331,12 +340,6 @@ module MatrixSdk ...@@ -331,12 +340,6 @@ module MatrixSdk
logger.warn "#{e.class} occured while printing request debug; #{e.message}\n#{e.backtrace.join "\n"}" logger.warn "#{e.class} occured while printing request debug; #{e.message}\n#{e.backtrace.join "\n"}"
end end
def transaction_id
ret = @transaction_id ||= 0
@transaction_id = @transaction_id.succ
ret
end
def api_to_path(api) def api_to_path(api)
# TODO: <api>_current / <api>_latest # TODO: <api>_current / <api>_latest
"/_matrix/#{api.to_s.split('_').join('/')}" "/_matrix/#{api.to_s.split('_').join('/')}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment