Several ways to define a hash in ruby:
hash = {
:key1 => "value1",
:key2 => "value2"
}
or with syntactic sugar:
hash = {
key1: "value1",
key2: "value2"
}
I prefer the latter as it is cleaner.
Several ways to define a hash in ruby:
hash = {
:key1 => "value1",
:key2 => "value2"
}
or with syntactic sugar:
hash = {
key1: "value1",
key2: "value2"
}
I prefer the latter as it is cleaner.