[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

What kind of inheritance is that?

Luiz Vitor Martinez Cardoso

2/3/2009 6:33:00 PM

I founded this code at WEBrick library:

class HTTPServer < ::WEBrick::GenericServer
def initialize(config=3D{}, default=3DConfig::HTTP)
super


What kind of inheritance is HTTPServer << ::WEBrick, I don't undestand de :=
:
before. What does it means?


--=20
Regards,

Luiz Vitor Martinez Cardoso
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br

"Posso nunca chegar a ser o melhor engenheiro do mundo, mas tenha certeza d=
e
que eu vou lutar com todas as minhas for=E7as para ser o melhor engenheiro =
que
eu puder ser"

1 Answer

ThoML

2/3/2009 6:37:00 PM

0

> What kind of inheritance is HTTPServer << ::WEBrick, I don't undestand de ::
> before. What does it means?

It's there to make sure the right class is used. Try:

class A
def foo
"a"
end
end

module B
class A
def foo
"ba"
end
end

p A.new.foo
p ::A.new.foo
end

"ba"
"a"
=> nil