What namespace are the builtin objects? I want to create an object in
other module that has the same name and uses the builtin object. For
example, if I wanted to create a hash that operated in a "special"
manor. I would create:
module Special
class Hash < Builtin::Hash
end
end
But from what I can tell the builtin hash is not in a namespace. So
how do I do this?
What namespace are the builtin objects? I want to create an object in
other module that has the same name and uses the builtin object. For
example, if I wanted to create a hash that operated in a “special”
manor. I would create:
module Special
class Hash < Builtin::Hash
end
end
But from what I can tell the builtin hash is not in a namespace. So
how do I do this?
The ``Builtin’’ Namespace is called Object - so write
this as
···
module Special
class Hash < Object::Hash
end
# or more conviently
class Array < Array
end
end
I think you can always refer to the root namespace with
::Class
I mean:
irb(main):001:0> module Special
irb(main):002:1> class Hash < ::Hash
irb(main):003:2> end
irb(main):004:1> end
=> nil
What namespace are the builtin objects? I want to create an object in
other module that has the same name and uses the builtin object. For
example, if I wanted to create a hash that operated in a “special”
manor. I would create:
module Special
class Hash < Builtin::Hash
end
end
But from what I can tell the builtin hash is not in a namespace. So
how do I do this?
On Tuesday, July 29, 2003, at 07:09 PM, Eric Anderson wrote:
What namespace are the builtin objects? I want to create an object in
other module that has the same name and uses the builtin object. For
example, if I wanted to create a hash that operated in a “special”
manor. I would create:
module Special
class Hash < Builtin::Hash
end
end
But from what I can tell the builtin hash is not in a namespace. So
how do I do this?