Class: Vultr::Middleware

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/vultr/middleware.rb

Constant Summary collapse

ISO_DATE_FORMAT =
/\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|((\+|-)\d{2}:?\d{2}))\Z/xm

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object

This method will be called when the response is being processed. You can alter it as you like, accessing things like response_body, response_headers, and more. Refer to Faraday::Env for a list of accessible fields: github.com/lostisland/faraday/blob/main/lib/faraday/options/env.rb

Parameters:

  • env (Faraday::Env)

    the environment of the response being processed.



13
14
15
# File 'lib/vultr/middleware.rb', line 13

def on_complete(env)
  parse_dates! env[:body]
end