struct

Secrets::Any

Inherits Struct < Value < Object

Constructors

from_yaml(yaml : String) : Any
Source
new(raw : Type)

Creates an Any that wraps the given Type.

Source
new(array : Array(String))

Creates an Any that wraps the given Array of Strings.

Source
new(hash : Hash(String, String))

Creates an Any that wraps the given Hash of Strings.

Source
new(any : YAML::Any)

Creates an Any from the raw value of a YAML::Any.

Source

Instance methods

[](index_or_key : Int32 | String) : Any

Assumes the underlying value is an Array or Hash and returns the element at the given index_or_key.

Raises if the underlying value is not an Array nor a Hash.

Source
[]=(index_or_key : Int32 | String, value : Type)

Assumes the underlying value is an Array or Hash and assigns a value at the given index_or_key.

Raises if the underlying value is not an Array nor a Hash.

Source
[]?(index_or_key : Int32 | String) : Any | Nil

Assumes the underlying value is an Array or Hash and returns the element at the given index_or_key, or nil if out of bounds or the key is missing.

Raises if the underlying value is not an Array nor a Hash.

Source
as_a

Checks that the underlying value is Array(String), and returns its value. Raises otherwise.

Source
as_a?

Checks that the underlying value is Array(String), and returns its value. Returns nil otherwise.

Source
as_h

Checks that the underlying value is Hash(String, String), and returns its value. Raises otherwise.

Source
as_h?

Checks that the underlying value is Hash(String, String), and returns its value. Returns nil otherwise.

Source
as_s

Checks that the underlying value is String, and returns its value. Raises otherwise.

Source
as_s?

Checks that the underlying value is String, and returns its value. Returns nil otherwise.

Source
raw

The raw underlying value, a Type.

Source

Nested types