« first day (1954 days earlier)      last day (1301 days later) » 

4:06 PM
I really like Ruby but the one thing that gets to me is the colon before the property name and the => after it, as a JavaScript developer it's almost impossible to get used to.
 
@LogicalBranch Hi! Can you show an example?
 
Hey, @WayneConrad I was referring to the code in Kevin's Comment.
 
It's got to be very confusing. Want a crash course in Ruby hash syntax?
 
4:37 PM
You can also write foo: bar as a shortcut for :foo => bar
 
That's the crash course right there.
 
the colon in :foo is to indicate a symbol literal. Symbols are like strings, except immutable, without string operations, and with a handy unary operator that turns :foo into ->x{x.foo}
=> just establishes a key-value relationship, and symbols are just a particularly common type of keys.
 

« first day (1954 days earlier)      last day (1301 days later) »