Skip to content
Browse files

Removing extra puts references.

Thanks to DeadAlready on reddit for this: http://www.reddit.com/r/programming/comments/erflu/i_know_you_guys_know_programming_but_if_someone/c1acu86

I'm not 100% sure how to incorporate the error in the tutorial. Maybe another Lesson?
  • Loading branch information...
1 parent 47f99e3 commit 5995fc60a876eb1c66fe94c6c8e72d8fb9813666 @steveklabnik steveklabnik committed Dec 26, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lessons/basic_ruby.rb
View
8 lessons/basic_ruby.rb
@@ -168,18 +168,18 @@
page "Adding numbers to words" do
para "That's why"
- embed_code 'puts "hey" + 2'
+ embed_code 'alert "hey" + 2'
para 'doesn\'t really work: "hey" is a ', code("String"), " object, and 2 is a ",
code("Fixnum"), " object. And adding ", code("String"), "s and ",
code("Fixnum"), "s doesn't make any sense. We can make this code work, though!"
para "All we need to do is turn the ", code("Fixnum"), " into a ", code("String"),
". We can do this by using the ", code("to_s"), " method."
- embed_code 'puts "hey" + 2.to_s'
+ embed_code 'alert "hey" + 2.to_s'
end
page "Let's look at that again" do
- embed_code 'puts "hey" + 2.to_s'
- para "Okay, this isn't bad. We have our ", code("puts"), " method. We're giving it ",
+ embed_code 'alert "hey" + 2.to_s'
+ para "Okay, this isn't bad. We have our ", code("alert"), " method. We're giving it ",
code('"hey" + 2.to_s'), ". The ", code("2.to_s"), " turns a ",
code("Fixnum"), " 2, which is like the mathematical idea of a 2, into the ",
code("String"), " 2, which is like when you write a 2 down on a piece of ",

0 comments on commit 5995fc6

Please sign in to comment.
Something went wrong with that request. Please try again.