2.4.3 (latest) 2.4.2 2.3.1 2.2.2 Reference documentation and code samples for the Google Cloud Platform environment queries class Google::Cloud::Env::Variables.

Access to system environment variables.


<br />

This is a hashlike object that controls access to environment variable
data. It supports temporarily changing the data source (i.e. swapping
::ENV out for a different set of data) for mocking.

## Inherits

- Object

## Methods

### #\[\]

```ruby
def [](key) -> String, nil
```
**Aliases**

- [#get](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-env/latest/Google-Cloud-Env-Variables.md.txt#Google__Cloud__Env__Variables_get_instance_)
Fetch the given environment variable from the backing data.
**Parameter**

- **key** (String)
**Returns**

- (String, nil)

### #backing_data

```ruby
def backing_data() -> Hash{String=>String}
```
The backing data is a hash or hash-like object that represents the
environment variable data. This can either be the actual environment
variables object (i.e. ENV) or a substitute hash used for mocking.
**Returns**

- (Hash{String=\>String})

### #backing_data=

```ruby
def backing_data=(value) -> Hash{String=>String}
```
The backing data is a hash or hash-like object that represents the
environment variable data. This can either be the actual environment
variables object (i.e. ENV) or a substitute hash used for mocking.
**Parameter**

- **value** (Hash{String=\>String})
**Returns**

- (Hash{String=\>String})

### #get

```ruby
def get(key) -> String, nil
```
**Alias Of** : [#\[\]](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-env/latest/Google-Cloud-Env-Variables.md.txt#Google__Cloud__Env__Variables_[]_instance_) Fetch the given environment variable from the backing data.
**Parameter**

- **key** (String)
**Returns**

- (String, nil)

### #initialize

```ruby
def initialize() -> Variables
```
Create an enviroment variables access object. This is initially
backed by the actual environment variables (i.e. ENV).
**Returns**

- ([Variables](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-env/latest/Google-Cloud-Env-Variables.md.txt)) --- a new instance of Variables

### #with_backing_data

```ruby
def with_backing_data(temp_backing_data)
```
Run the given block with the backing data replaced with the given
hash. The original backing data is restored afterward. This is used
for debugging/testing/mocking.
**Parameter**

- **temp_backing_data** (Hash{String=\>String})