Collections

Symbols

Use symbols as stable hash keys.

Reference View source
Source collections/symbols.vibe
# vibe: 0.2

def permission_keys
  [:read, :write, :delete]
end

def fetch_symbol_key(record, key)
  record[key]
end

def run
  {
    keys: permission_keys,
    fetched: fetch_symbol_key({ name: "Alice", role: "coach" }, :name)
  }
end
Output
Press Run example to run this code.