ffi - How to bring methods from a module into the scope of the caller of a method in ruby? -


the code should this:

def bring_into_scope(module)   #here caller of method should methods +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 functinality because want write library inlines rust code, 1 should able write:

class rustandruby   def ruby_method; end    #this should make fn's in rust code available in rustandruby   rust.code {     "string rust code..."   } end 

is possible in ruby? (if need further information feel free ask!)

maybe take @ this, written 1 of main contributors of rust.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -