title: Can I use something along the lines of String#constantize to initialize a Hyperstack::Component?
body: <p>I have some objects in my DB that I like to render with a dedicated Hyperstack view Component.
  Lets say my objects have a unique <code>name</code> property from A to J. Now I would like to loop through them with <code>each</code> and render a <code>ComponentA</code>, <code>ComponentB</code>, <code>ComponentC</code>, ... depending on the <code>name</code> of my object, and pass my object as a param to the component.</p>
  
  <p>What I do now is:</p>
  
  <pre class="lang-rb prettyprint-override"><code>DB_Objects.each do |object|
    if    object.name == 'A'
      ComponentA(data: object)
    elsif object.name == 'B'
      ComponentB(data: object)
    elsif object.name == 'C'
      ComponentC(data: object)
    elsif ...
  </code></pre>
  
  <p>What I want to do is something like:</p>
  
  <pre class="lang-rb prettyprint-override"><code>DB_Objects.each do |object|
    ('Component' + object.name).constantize(data: object)
  end
  </code></pre>
  
  <p>This is pseudo code as you can't give variables to constantize.
  But it shows what I would like to do.</p>
  
  <p>How can I prevent a manual mapping of a object to its view.</p>