Module: Buby::Implants::JavaClass
- Included in:
- Java::JavaClass
- Defined in:
- lib/buby/implants/jruby.rb
Instance Method Summary collapse
-
#rewrap_java_method(java_id) ⇒ Object
copies wrapper_id method to java_id and all ruby-like aliases used to re-attach java method proxies to new call wrapper.
- #ruby_names_for_java_method(meth) ⇒ Object
Instance Method Details
#rewrap_java_method(java_id) ⇒ Object
copies wrapper_id method to java_id and all ruby-like aliases used to re-attach java method proxies to new call wrapper
42 43 44 45 46 |
# File 'lib/buby/implants/jruby.rb', line 42 def rewrap_java_method java_id ruby_names_for_java_method(java_id).each do |ruby_name| alias_method(ruby_name, java_id) unless wrapper_id == ruby_name end end |
#ruby_names_for_java_method(meth) ⇒ Object
32 33 34 35 36 |
# File 'lib/buby/implants/jruby.rb', line 32 def ruby_names_for_java_method meth self_java_ref = JRuby.reference(self).javaClass target_methods = self_java_ref.getMethods.group_by{|jmeth| jmeth.name}[meth.to_s] Java::OrgJrubyJavasupport::JavaUtil.getRubyNamesForJavaName(target_methods.first.name, target_methods) end |