concept method in category lift

This is an excerpt from Manning's book Lift in Action: The Simply Functional Web Framework for Scala.
This example defines a value in the first line, which represents a JSON structure with Scala tuples. This structure is then rendered to JSON by using the compact and render methods from the JsonAST object in the second line. Here’s the output:
Methods are defined upon classes by using the def keyword, and in this case the resulting type is again inferred by the compiler to be a string. Class methods in Scala don’t need to be explicitly wrapped in curly braces unless the method requires some kind of internal assignment, because all control structures within Scala return a concrete type. Consider the following two method definitions:
def whatever = if(bar > 3) "Awesome" else "Amazing" def another { if(bar > 3) "Awesome" else "Amazing" }These two method implementations look exceedingly similar, and the unfamiliar eye might assume that they do the same thing. In fact, whatever returns a String whereas another returns a special Scala type called Unit. The reason for this is that the definition of another lacks the equals sign (=) after the method name and immediately wraps the whole method in curly braces; this makes Scala assume that the method is side-effecting and thus returns nothing directly useful. If you’re coming from other statically typed languages, you can think of the Unit type as being analogous to the void construct.
Methods can also take arguments in exactly the same way that Java methods can, but within Scala it’s also possible have multiple argument groups. This can be useful, because it allows you to make flexible APIs that can have both arguments and pseudoblocks. Here’s an example of the definition: