R – What does the right arrow do in this code: “Ramaze.start :port => 80”


Ramaze.start :port => 80

If my understanding is correct, the line above is a method call in Ruby and you could also write it as:

Ramaze.start(:port => 80)

But in either case, what does it mean when you put the => character between the symbol :port and the number 80?

Is that a way of creating a Hash?

When the Ramaze.start method receives the method parameters, what is the type of the argument?

Is it received as a single argument key-value pair?

Or it received as two arguments: :port and 80?

Best Solution

It creates a hashmap where the symbol :port is the key and the value is 80.