Test a json value to see if it exists and is true?

Given the file data/publications.json, I’d like to test that

  1. the feature key exists and
  2. that the value is true

and if both of those conditions are met, then print some other values into a haml template.

data/publications.json looks like this:

{
  "publications": [
    {
      "title": "Book title 1",
      "author": "Arthur Author",
      "summary": "The book's main chapters take you through building a social news site.",
      "cover": "http://placehold.it/350x450",
      "featured": "true"
    }
]
}

and the haml code looks like this:

- data.releases.publications.has_key("feature").each_with_index do | publication |
    .recent-item-wrapper
      .recent-image
        %img{:src => "#{publication.cover}", :width => "200px"}
      .recent-meta
        %h3=publication.title
        %h4=publication.author

but it just produces an error. Can someone please help?
%p=publication.summary

So of course I figured it out 5 minutes after posting this…

- data.releases.publications.each_with_index do | publication |
  - unless publication.featured === 'true'
    .recent-item-wrapper
      .recent-image
        %img{:src => "#{publication.cover}", :width => "200px"}
      .recent-meta
        %h3=publication.title
        %h4=publication.author
        %p=publication.summary