Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created August 5, 2011 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasberth/1126905 to your computer and use it in GitHub Desktop.
Save pasberth/1126905 to your computer and use it in GitHub Desktop.
# -*- 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