Any body now how to do some thing like this in ruby
is_class_defined?
is_module_defined?
is_methode_defined?
regards
Eko
Any body now how to do some thing like this in ruby
is_class_defined?
is_module_defined?
is_methode_defined?
regards
Eko
def foo; end
defined?(foo) # => "method"
Both of the following return "constant."
class Foo; end
module Bar; end
defined?(Foo) # => "constant"
defined?(Bar) # => "constant"
-austin
On Mon, 28 Feb 2005 12:11:21 +0900, Eko Budi Setiyo <contact_us@haltebis.com> wrote:
Any body now how to do some thing like this in ruby
is_class_defined?
is_module_defined?
is_methode_defined?
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
Out of curiosity, why doesn't this work:
irb(main):014:0> defined? defined?
SyntaxError: compile error
(irb):14: syntax error
from (irb):14
Cheers,
Navin.
Austin Ziegler <halostatue@gmail.com> wrote:
def foo; end
defined?(foo) # => "method"Both of the following return "constant."
class Foo; end
module Bar; end
defined?(Foo) # => "constant"
defined?(Bar) # => "constant"
Austin Ziegler wrote:
On Mon, 28 Feb 2005 12:11:21 +0900, Eko Budi Setiyo ><contact_us@haltebis.com> wrote:
Any body now how to do some thing like this in ruby
is_class_defined?
is_module_defined?
is_methode_defined?
def foo; end
defined?(foo) # => "method"Both of the following return "constant."
class Foo; end
module Bar; end
defined?(Foo) # => "constant"
defined?(Bar) # => "constant"-austin
Thanks
defined? may be a keyword. I don't recall for certain.
-austin
On Mon, 28 Feb 2005 12:33:35 +0900, Navindra Umanee <navindra@cs.mcgill.ca> wrote:
Out of curiosity, why doesn't this work:
irb(main):014:0> defined? defined?
SyntaxError: compile error
(irb):14: syntax error
from (irb):14
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
Hi,
In mail "Re: is_defined?"
Navindra Umanee <navindra@cs.mcgill.ca> wrote:
Out of curiosity, why doesn't this work:
irb(main):014:0> defined? defined?
SyntaxError: compile error
Because second defined? does not have argument.
~ % ruby -e 'p defined?(defined?(nil))'
"expression"
Minero Aoki
Hi,
Am Montag, 28. Feb 2005, 12:33:35 +0900 schrieb Navindra Umanee:
Austin Ziegler <halostatue@gmail.com> wrote:
> def foo; end
> defined?(foo) # => "method"Out of curiosity, why doesn't this work:
irb(main):014:0> defined? defined?
SyntaxError: compile error
(irb):14: syntax error
from (irb):14
`defined?' is an operator, not a method.
This is confusing as `Module#method_defined?' and
`Module#const_defined?' are methods.
Bertram
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de