The code should look like this:
def bring_into_scope(module)
#here the caller of the method should get methods from +module+
end
class Bar
def bar_method
#do stuff
end
end
class Foo
def initialize(bar)
bring_into_scope(bar)
bar_method
end
end
I need the functinality because I want to write a library that inlines rust code, so one should be able to write:
class RustAndRuby
def ruby_method; end
#this should make all fn's in the rust code available in RustAndRuby
Rust.code {
"String with rust code..."
}
end
Is this possible in ruby? (If you need further information feel free to ask!)