Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #7086
| From | Michael Uplawski <michael.uplawski@uplawski.eu> |
|---|---|
| Newsgroups | comp.lang.ruby |
| Subject | Re: Trying to gain access to a variable inside a module from within a class and I can't |
| Date | 2015-01-16 07:42 +0100 |
| Organization | news.babsi.de for open-news-network.org |
| Message-ID | <slrnmbhclt.28i.michael.uplawski@drusus.uplawski.eu> (permalink) |
| References | <d57403f6-675b-4a77-b54f-72e4002fa111@googlegroups.com> |
Good morning.
On Thu, 15 Jan 2015 08:06:30 -0800 (PST),
trekr5 <cebirim@gmail.com> wrote:
> Hello everyone,
>
> Would appreciate someone's help here.
Would you mind showing us the problem description in textual form, as I
believe, you mixed up something. Your x is a local variable, but I think
that the variable that was asked for was either an instance- or a
class-variable.
> I would like to gain access to the variable x within module Tester.
> How would I do this?
Just make sure, that your effort corresponds to the instruction.
Apart from that, have you tried
puts testing
from inside your Dog-instance ?
Cheerio,
Michael
>
> When I try to access the variable from within the class Dog (puts x),
> I get an error of undefined variable x. Can anyone tell me how I can
> get access to it?
>
> Many thanks
>
>
>
--
GnuPG/OpenPGP 4096R/3216CF02 2013-11-15 [expires: 2015-11-15]
sub 4096R/2751C550 2013-11-15 [expires: 2015-11-15]
Back to comp.lang.ruby | Previous | Next — Previous in thread | Find similar
Trying to gain access to a variable inside a module from within a class and I can't trekr5 <cebirim@gmail.com> - 2015-01-15 08:06 -0800 Re: Trying to gain access to a variable inside a module from within a class and I can't Michael Uplawski <michael.uplawski@uplawski.eu> - 2015-01-16 07:42 +0100
csiph-web