title: What's the best way to extract a value from a scala case class?
body: <p>What would be the best and/or easiest way to extract a value that I've saved in a case class?</p>
  
  <p>take for example the following code:</p>
  
  <pre><code>abstract class Something
  case class Foo(input: Int) extends Something
  case class Bar(input: Double) extends Something
  
  def someMethod(a: Something, b: Something) {
      // code that extracts values goes here
  }
  
  someMethod(Foo(10), Foo(20))
  someMethod(Bar(2.1), Bar(21.2))
  </code></pre>
  
  <p>how would I then go about getting the integer or the double itself out of <code>a</code> and <code>b</code> when I call the method like I did under its definition?</p>
  
  <p>Note that both the parameters are used in the same equation</p>