hashrocket Questions

5

Solved

Is there any difference between :key => "value" (hashrocket) and key: "value" (Ruby 1.9) notations? If not, then I would like to use key: "value" notation. Is there a gem that helps me to conve...
Powder asked 30/12, 2011 at 1:9

2

Solved

Given the example: def method_of_doom my_string = "I sense impending doom." my_string.ah_ha_i_called_a_nonexistent_method rescue NoMethodError => e: puts "PROBLEM: " + e.to_s rescue Exception: ...
Metalloid asked 17/1, 2013 at 23:45

1

Solved

The well-cited RIP Hash rocket post would seem to imply the Hash Rocket syntax (:foo => "bar") is deprecated in favor of the new-to-Ruby JSON-style hash (foo: "bar"), but I can't find any defini...
Florrieflorry asked 4/4, 2012 at 2:23

3

Solved

The rescue which could assigns a variable to reference the error object has this syntax (=>) rescue => e If rescue is the one of the general method call, what's the meaning of =>. Could...
Overtask asked 13/3, 2012 at 15:25

2

Solved

What's the difference between colon : and fat arrow => in Ruby? Or when to use what? :foo => true foo: true
Oxidate asked 20/11, 2011 at 1:43

5

Solved

While learning Ruby I've come across the "=>" operator on occasion. Usually I see it in the form of :symbol => value and it seems to be used frequently when passing values to functions...
Indies asked 11/1, 2011 at 21:56
1

© 2022 - 2024 — McMap. All rights reserved.