Doubts about an example in Poignant Guide

D

Damaris Fuentes

Hi,
I'm reading "Why's guide to ruby" and I have two doubts about the
example of Endertromb, mindreaders, etc.

Firstly, He creates the class "MindReader" where he uses
"EnderTromb::scan_for_sentence". However, there is no EnderTromb class
in the manual.

Even though I can skip that part and initialize the sentence "manually",
I've found that he uses a mind.read method. That is, a "read" method on
a string. And it gives me back an error.

Has anybody come across these errors? If so, I will be pleased to know
how can I solve them :)

Thanks
PT: And thanks for being a vivid forum! You're really really useful for
people starting like me!
 
M

Mat Schaffer

Hi,
I'm reading "Why's guide to ruby" and I have two doubts about the
example of Endertromb, mindreaders, etc.

Firstly, He creates the class "MindReader" where he uses
"EnderTromb::scan_for_sentence". However, there is no EnderTromb class
in the manual.

Even though I can skip that part and initialize the sentence
"manually",
I've found that he uses a mind.read method. That is, a "read"
method on
a string. And it gives me back an error.

Has anybody come across these errors? If so, I will be pleased to know
how can I solve them :)

Thanks
PT: And thanks for being a vivid forum! You're really really useful
for
people starting like me!

_why may have something to say here, but I'm not sure why you're
saying mind is a string. I don't see the actual type of mind defined
anywhere. As for EnderTromb, it's included from endertromb.rb, it
says. So it's defined there.

I think part of it is that you have to relax a little and give into
the programming-as-language idea. You can dig down if you have too,
but for an example like this, you don't have to. You know what
mind.read does just by looking at it. It reads minds of course!
How? Leave that up to the author :)
-Mat
 
D

Damaris Fuentes

Yes, I guess you are completely right :) I was trying to give life to
EnderTromb planet myself and I was getting crazy :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top