Class: Binance::Client::REST::TimestampRequestMiddleware

Inherits:
Struct
  • Object
show all
Defined in:
lib/binance/client/rest/timestamp_request_middleware.rb

Overview

Generate a timestamp in milliseconds and append to query string

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



8
9
10
# File 'lib/binance/client/rest/timestamp_request_middleware.rb', line 8

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/binance/client/rest/timestamp_request_middleware.rb', line 9

def call(env)
  env.url.query = REST.add_query_param(
    env.url.query, 'timestamp', DateTime.now.strftime('%Q')
  )

  app.call env
end