What kind of inheritance is that?

  • Thread starter Luiz Vitor Martinez Cardoso
  • Start date
L

Luiz Vitor Martinez Cardoso

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"
 
T

Tom Link

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
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top