S
Sarah Allen
I had understood that operators, like minus (-), had special "syntactic
sugar" that allowed me to include or omit spaces around them like this:
=> 0
However, in some cases, spaces seem to matter:
NoMethodError: undefined method `-@' for Tue Apr 13 13:40:24 -0700
2010:Time
from (irb):6=> 6.895787
Can someone explain what "undefined method `-@'" refers to?
Here's my version of Ruby if it matters:
$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Thanks,
Sarah
http://www.ultrasarus.com
sugar" that allowed me to include or omit spaces around them like this:
=> 0
However, in some cases, spaces seem to matter:
NoMethodError: undefined method `-@' for Tue Apr 13 13:40:24 -0700
2010:Time
from (irb):6=> 6.895787
Can someone explain what "undefined method `-@'" refers to?
Here's my version of Ruby if it matters:
$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Thanks,
Sarah
http://www.ultrasarus.com