Sha256: 47c22e0358a9de79be4827afd17ce19449da44b91978d6ec237bf085195fdf8f

Contents?: true

Size: 876 Bytes

Versions: 7

Compression:

Stored size: 876 Bytes

Contents

[<< back](../README.md)

1. [Description](#description)
2. [Usage](#usage)
3. [Examples](#examples)

## Description

`get` read param value from configuration file.

## Usage

```ruby
get(PARAM)
```

## Examples

**Reading example**: Suppose we have this `config.yaml` content:

```yaml
---
:global:
  :host1_username: root
  :host1_password: secret
:cases:
- :tt_members: Obiwan
  :host1_ip: 192.168.1.201
  :host1_hostname: jedis
  :username: obiwan
```

Supossing we are **case 01**, then:
* `get(:username)` returns `obiwan`.
* `get(:host1_username)`, returns `root`.

**Writting example**: We also can create new temporal params:

```ruby
set(:name, "Obiwan")
var = get(:name)
```

So `var` value is "Obiwan".

**Simpler reading example**: Other ways or reading param values:

```ruby
var = _name
```

So `var` value is "Obiwan" too. `_name` is an alias of `get(:name)`.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
teuton-2.4.1 docs/dsl/setting/get.md
teuton-2.4.0 docs/dsl/setting/get.md
teuton-2.3.11 docs/dsl/setting/get.md
teuton-2.3.10 docs/dsl/setting/get.md
teuton-2.3.9 docs/dsl/setting/get.md
teuton-2.3.8 docs/dsl/setting/get.md
teuton-2.3.7 docs/dsl/setting/get.md