title: How do I access Ruby/Object Attributes
body: <p>The debug output looks like this:</p>
  
  <pre><code>!ruby/object:Business 
  attributes:
    business_type: 8
    type_count: 2
  </code></pre>
  
  <p>But how do I access those attributes?</p>
  
  <p>I'm feeling dumb here :/</p>
  
  <p>EDIT: 
  some more code from my view:</p>
  
  <pre><code>&lt;% @serviceSections.each do |k,v| %&gt;
  &lt;% c = @bc.select{|s| s.business_type == k} %&gt;  
  &lt;%= debug(c.type_count) %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Which just gives me the error</p>
  
  <blockquote>
    <p>undefined method `type_count' for [# &lt; Business business_type: 8>]:Array</p>
  </blockquote>
  
  <p>EDIT2</p>
  
  <p>Im mostly an idiot :-) it was late....</p>
  
  <p>all I needed to do was actually check:</p>
  
  <pre><code>&lt;% if !c.respond_to?("type_count") %&gt;
  </code></pre>