title: Get the total cost in ruby based on item name, value and class object array
body: <p>I have the following array</p>
  
  <pre><code>class_object = [Foo.new(item: 'apples', value: 100), Foo.new(item: 'bananas', value: 100)]
  </code></pre>
  
  <p>I then have a function:</p>
  
  <pre><code>initialize(item_name, quantity)
    # get price
  end
  </code></pre>
  
  <p>I want to say: search the class_object for a name that matches <code>item_name</code>, then take the quantity and multiply it by the value to then give me an expected out put of, assuming the item_name is apples and the quantity is 6:</p>
  
  <pre><code>apples 600
  </code></pre>