Closed leizzer closed 14 years ago
More spesific, in "help 1": But you can always convert between different types using Ruby's "to" methods.
* to_s converts things to strings.
* to_i converts things to integers (numbers.)
* to_a converts things to arrays.
check out: http://blog.grayproductions.net/articles/getting_code_ready_for_ruby_19
It isn't so much deprecated as it has evolved :-)
whereas before you may have (or haven't before )typed
reddit = "I Haz Narwhal".to_a
Now it's:
reddit = "I Haz Narwhal".reddit.to_a
This seems odd that they would go backwards.
However, when I tried this just now in tryruby, it failed to return anything.
So, it turns out that this really is a bug (for to_a) at least. to_s works and to_i appears to work.
I'll look into this later today. Thanks for the bug report.
I stand hugely corrected. to_a by default is no longer there for a string!
see: http://dablog.rubypal.com/2009/1/16/son-of-10-things-to-be-aware-of-in-ruby-1-9
Does anyone know of any authoritative 1.9 change log other than the one straight from matz?
It might be worth the time to have a off to the side widget or maybe a built in function that will alert you of depreciated syntax.
I'm leaving this ticket open for the purpose of discussion.
Is this "straight from matz"? http://svn.ruby-lang.org/repos/ruby/trunk/NEWS or http://svn.ruby-lang.org/repos/ruby/trunk/ChangeLog
this is a good resource, but it needs to be more accessible. I'll get around to it if i can ever get the time to finish stabilizing this project first.
I still intended to eventually extend out a R bridge and have the popup module be useful as a graph calculator output.
Also, new lessons would be nice. Some ideas for lessons include using rspec or cucumber.
These are all things on my agenda that I plan on implementing.
Hopefully things will slow down for me in the next month or so.
For strings, you can use String#split
.
This issue should be no longer an issue.
This infact does not appear to be an issue closing. I have done a radical amount of re factoring on the "rails" branch. Any remaining issue will be tagged as still being an issue in the rails branch.
im trying the 1.9 version, and the to_a method throw an error, i think it is obsolete in 1.9