title: Accessing Companion Class variable from another class
body: <p>I am really new to scala. I am trying to access a companion class variable from outside the class. How do I do this if at all possible without creating an instance of the class.</p>
  
  <p>In the following example, I can access INTERNAL_COST_REQUESTS from within the YotascaleCostProcessing class</p>
  
  <pre><code>package com.yotascale
  class YotascaleCostProcessing extends YotascaleActorSystem{
  
   //companion object
   object YotascaleCostProcessing{
   val INTERNAL_COST_REQUESTS = "internal-cost-requests"
   val INTERNAL_COST_UPDATES = "internal-cost-updates"
  }
  
  def setupInfrastructure() = {
      QueueService.createQueue(YotascaleCostProcessing.INTERNAL_COST_REQUESTS)
      QueueService.createQueue(YotascaleCostProcessing.INTERNAL_COST_UPDATES)
    }
  }
  </code></pre>
  
  <p>When I do YotascaleCostProcessing.INTERNAL_COST_UPDATES from another class in another package, I get an error "not found: value YotascaleCostProcessing" even though the import for YotascaleCostProcessing is there. The only way this works is when I do this: new YotascaleCostProcessing().YotascaleCostProcessing.INTERNAL_COST_UPDATES</p>
  
  <pre><code>package com.yotascale.service.cost.setup;
  import com.yotascale.YotascaleCostProcessing
  class MetadataNotificationConfiguringActor(message:Message) extends UntypedActor {
  
  def configureBucket() = {
   val realtimeupdates = QueueService.getQueueURL(YotascaleCostProcessing.INTERNAL_COST_REQUESTS)   
  }
  }
  </code></pre>