Sophrinix / TryRuby

Try Ruby is a interactive shell that quickly and whimsically teaches the Ruby programming language. Originally _why's idea, it has been recreated from the ground up by Rubyists who have a passion for Ruby and for teaching their fellow (wo)man how to program.
tryruby.org
345 stars 80 forks source link

poem.delete doesn't work #148

Open avjgit opened 12 years ago

avjgit commented 12 years ago

gives out error "ArgumentError: wrong number of arguments (at least 1) "

davidmiani commented 12 years ago

poem is a String, and the delete method on String requires one argument. Eg poem.delete "aeiou" will return a string containing the contents of poem but with all the vowels deleted.

So this is correct behaviour.

ghost commented 12 years ago

okay, but the instructions in the tutorial just say: try poem.delete they do not say: try poem.delete "aeiou"

tedkspradley commented 12 years ago

hmmm... I agree that the behavior should be to delete all of the vowels according to the string methods documentation, however, my experience is this:

poem.delete "aeiou"
ArgumentError: wrong number of arguments (at least 1)

tedkspradley commented 12 years ago

it may be related to something else, b/c the next command in the tutorial is to create an empty hash called 'books', but I get the same ArgumentError

books ={}
ArgumentError: wrong number of arguments (at least 1)

tedkspradley commented 12 years ago

It appears that the string (or whatever data structure) called poem no longer exists for me in the tutorial.

print poem
ArgumentError: wrong number of arguments (at least 1)