I got some newbie questions which I would very much appreciate if
someone could answer (in a way that a newbie would understand):
-
What does @ mean in Ruby? Im sure I have seen variables like this:
@variable. A new datatype like the :symbol perhaps? -
myhash = Hash.new {0}
anotherhash.values.each {|x| thecreatedhash[x] += 1}
What makes the hash created above different from a hash created the
normal way? I can execute the block on a hash created with that method
but not a normal empty hash created manually.
- Is there any difference between these three:
Dir.entries “the directory”
Dir[""]
Dir.glob ""
If you use them on the same directory?
Thanks in advance!