Module: Truffle::Interop

Defined in:
truffle/src/main/ruby/core/truffle/interop.rb

Defined Under Namespace

Classes: ForeignEnumerable

Class Method Summary (collapse)

Class Method Details

+ (Object) enumerable(foreign)



48
49
50
# File 'truffle/src/main/ruby/core/truffle/interop.rb', line 48

def self.enumerable(foreign)
  ForeignEnumerable.new(foreign)
end

+ (Object) export_method(name)



23
24
25
# File 'truffle/src/main/ruby/core/truffle/interop.rb', line 23

def self.export_method(name)
  export(name.to_s, Object.method(name.to_sym))
end

+ (Object) import_method(name)



13
14
15
16
17
18
19
20
21
# File 'truffle/src/main/ruby/core/truffle/interop.rb', line 13

def self.import_method(name)
  method = import(name.to_s)

  Object.class_eval do
    define_method(name.to_sym) do |*args|
      Truffle::Interop.execute(method, *args)
    end
  end
end