class Google::Cloud::Env::ComputeMetadata::Response
Basic HTTP response object, returned by {ComputeMetadata#lookup_response}.
This object duck-types the ‘status`, `body`, and `headers` fields of `Faraday::Response`. It also includes the CLOCK_MONOTONIC time when the data was retrieved.
Attributes
The HTTP response body @return [String]
The HTTP response headers @return [Hash{String=>String}]
The CLOCK_MONOTONIC time at which this response was retrieved. @return [Numeric]
The HTTP status code @return [Integer]
Public Class Methods
Source
# File lib/google/cloud/env/compute_metadata.rb, line 106 def initialize status, body, headers @status = status @body = body @headers = headers @retrieval_monotonic_time = Process.clock_gettime Process::CLOCK_MONOTONIC end
Create a response object.
@param status [Integer] The HTTP status, normally 200 @param body [String] The HTTP body as a string @param headers [Hash{String=>String}] The HTTP response headers.
Normally, the `Metadata-Flavor` header must be set to the value `Google`.