title: `map` based on condition
body: <p>I have a struct like this:</p>
  
  <pre><code>Struct.new("Test", :loc, :type, :hostname, :ip)
  
  clients = [
  Struct::TestClient.new(1, :pc, "pc1", "192.168.0.1")
  Struct::TestClient.new(1, :pc, "pc2", "192.168.0.2")
  Struct::TestClient.new(1, :tablet, "tablet1", "192.168.0.3")
  Struct::TestClient.new(1, :tablet, "tablet2", "192.168.0.3")
  and etc...
  ]
  </code></pre>
  
  <p>If I want to get the IP address of all devices, I can use <code>test_clients.map(&amp;:ip)</code>. How do I select the IP addresses of specific devices, say all device types called <code>"tablet"</code>? How can I do that with <code>map</code>?</p>