Class: Module
Instance Method Summary collapse
- #dyn_const_get(sym) ⇒ Object
- #include(mod) ⇒ Object
-
#parents ⇒ Object
alias :rmasm_old_const_missing :const_missing.
- #rmasm_old_include_method ⇒ Object
Instance Method Details
#dyn_const_get(sym) ⇒ Object
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/rmasm/core_override.rb', line 102 def dyn_const_get(sym) @rmasm_module_hierarchy ||= (name.split('::').inject([Object]) { |hierarchy, name| hierarchy << hierarchy.last.const_get(name) }).reverse for mod in @rmasm_module_hierarchy begin return mod.const_get(sym) rescue end end nil end |
#include(mod) ⇒ Object
115 116 117 118 119 120 121 |
# File 'lib/rmasm/core_override.rb', line 115 def include(mod) if mod.is_a?(String) RMasm.include_rasm_file(self, mod) else rmasm_old_include_method mod end end |
#parents ⇒ Object
alias :rmasm_old_const_missing :const_missing
98 99 100 |
# File 'lib/rmasm/core_override.rb', line 98 def parents (name.split('::').inject([Object]) {|hierarchy, name| hierarchy << hierarchy.last.const_get(name) }).reverse end |
#rmasm_old_include_method ⇒ Object
113 |
# File 'lib/rmasm/core_override.rb', line 113 alias :rmasm_old_include_method :include |