Module: Openstack::Helpers::CacheableBody

Defined in:
lib/openstack/helpers/cacheable_body.rb

Overview

cache-friendly response body.

Instance Method Summary collapse

Instance Method Details

#body_to_cacheObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/openstack/helpers/cacheable_body.rb', line 7

def body_to_cache
  # We cache JSON rather than ruby object. Simple object.
  {
    headers: headers,
    token: token,
    expires_at: expires_at,
    code: Integer(code),
    message: message,
    body: body_as_hash
  }.to_json
end