Is there a way to create a scala dsl which enables me to write code similar to this pseudo-code
edited: changed to scala pseudo code
object AccessProtectedClass extends App{
def protectedMethod(param:String)
permit_if (param.startsWith("asdf") and RAM <= 10) : Int = {
var result = 10
//do something
return result;
}
}
If the access is not granted due to the 'permit if' statement a exception should be thrown. Which scala concepts do I need?