struct Secrets::Any

Defined in:

secrets/any.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_yaml(yaml : String) : Any #

[View source]
def self.new(raw : Type) #

Creates an Any that wraps the given Type.


[View source]
def self.new(array : Array(String)) #

Creates an Any that wraps the given Array of Strings.


[View source]
def self.new(hash : Hash(String, String)) #

Creates an Any that wraps the given Hash of Strings.


[View source]
def self.new(any : YAML::Any) #

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


[View source]

Instance Method Detail

def [](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.


[View source]
def []=(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.


[View source]
def []?(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.


[View source]
def as_a : Array(String) #

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


[View source]
def as_a? : Array(String) | Nil #

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


[View source]
def as_h : Hash(String, String) #

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


[View source]
def as_h? : Hash(String, String) | Nil #

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


[View source]
def as_s : String #

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


[View source]
def as_s? : String | Nil #

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


[View source]
def raw : Type #

The raw underlying value, a Type.


[View source]
def to_yaml(yaml : YAML::Nodes::Builder) #

[View source]