Created
August 5, 2011 04:07
-
-
Save pasberth/1126905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# importas は Python で言う import MyClass as RenamedMyClass 的なことをできます | |
# importas Namespace::MyClass, :RenamedMyClass とします | |
def importas(from, to_name) | |
Kernel.const_set(to_name, from) | |
end | |
=begin | |
module Namespace | |
class File; end | |
end | |
importas Namespace::File, :NFile | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment