How to access to a key in the hash?

I’ve a local variable that contains the following hash retrieved from the frontmatter of a file using the YAML.load function. The content is then returned into a variable called test

 {"class"=>"default", "text"=>"My Text!", "url"=>"#"}

I don’t know how to access to the individual keys.

I tried in several ways, including

<%= test.("#{url}") %>

But all I get is an error from the compiler who doesn’t know the local variable.

If I do something like

<%= test[:url] %>

I get no output, but also no errors, meaning that I may potentially be on the right way?
Is there anything I can read re ruby to learn this kind of things?

Thanks

---
title: Welcome to Middleman
hash:
  ruby: One
  python: Two
---

<div class="welcome">
  <div class="logo">
    <%= image_tag "middleman-logo.svg" %>
  </div>
  <h1>Middleman is Running</h1>
  <h3><%=current_page.data["hash"]["ruby"]%></h3>
   
  <%- local_var = current_page.data["hash"]["ruby"] %>
  <h4><%=local_var %></h4>
  
  <p class="doc">
    <%= link_to "Read Documentation Online", "https://middlemanapp.com", target: "_blank" %>
  </p><!-- .doc -->
</div><!-- .welcome -->

I have a YAML hash above that outputs properly for me. I can call the values directly (top example), or add them to a local variable (bottom example). Let me know if this helps.

Your keys are strings, not symbols, so try

<%= test["url"] %>

Thanks … thought this was a “YAML” object …