Module: Kernel

Defined in:
lib/ostrich-jruby/scala/kernel.rb

Instance Method Summary collapse

Instance Method Details

#companion(klass, *names) ⇒ Object



2
3
4
5
6
# File 'lib/ostrich-jruby/scala/kernel.rb', line 2

def companion(klass, *names)
  singleton = klass.const_get(:"#{names.join("$")}$")
  field = singleton.java_class.field(:"MODULE$")
  field.value(singleton)
end