title: How to access an Enum object inside a scala class
body: <p>I'd like to know what the proper syntax is for accessing an enum inside a class, from both inside and outside it.</p>
  
  <p>My code:</p>
  
  <pre><code>final class Celig {
  
    object eNums extends Enumeration {
      type eNums = Value
      val NAM, YEE = Value
    }
  
    // Here I'd like to assign a method that always returns a specific enum value
    var nammy = eNums.NAM
    def getNam: eNums.eNums = nammy
  }
  </code></pre>
  
  <p>This code compiles, but it's on the ugly side.</p>
  
  <p>I would like to know if a value of the Enum can be accessed in a cleaner way from inside the class, for example without the "eNums.eNums", and I'm also curious as to how to access a value of the enum from outside the class. </p>
  
  <p>Edit: I would also like to know if it is possible to use a value in the default constructor that takes a value of the eNums type, for example, adding (car: Celig.eNums ) to the class header.</p>
  
  <p>Thanks</p>