org.jruby.RubyModule.calculateName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中org.jruby.RubyModule.calculateName方法的一些代码示例,展示了RubyModule.calculateName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.calculateName方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:calculateName

RubyModule.calculateName介绍

[英]Recalculate the fully-qualified name of this class/module.
[中]重新计算此类/模块的完全限定名。

代码示例

代码示例来源:origin: org.jruby/jruby-complete

/**
 * Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
 *
 * Ruby C equivalent = "classname"
 *
 * @return The generated class name
 */
public String getName() {
  if (cachedName != null) return cachedName;
  return calculateName();
}

代码示例来源:origin: org.jruby/jruby-core

/**
 * Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
 *
 * Ruby C equivalent = "classname"
 *
 * @return The generated class name
 */
public String getName() {
  if (cachedName != null) return cachedName;
  return calculateName();
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
 * 
 * Ruby C equivalent = "classname"
 * 
 * @return The generated class name
 */
public String getName() {
  if (cachedName != null) return cachedName;
  return calculateName();
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
 * 
 * Ruby C equivalent = "classname"
 * 
 * @return The generated class name
 */
public String getName() {
  if (cachedName != null) return cachedName;
  return calculateName();
}

代码示例来源:origin: org.jruby/jruby-complete

private void setParentForModule(final String name, final IRubyObject value) {
  // if adding a module under a constant name, set that module's basename to the constant name
  if ( value instanceof RubyModule ) {
    RubyModule module = (RubyModule) value;
    if (module != this && module.getBaseName() == null) {
      module.setBaseName(name);
      module.setParent(this);
    }
    module.calculateName();
  }
}

代码示例来源:origin: org.jruby/jruby-core

private void setParentForModule(final String name, final IRubyObject value) {
  // if adding a module under a constant name, set that module's basename to the constant name
  if ( value instanceof RubyModule ) {
    RubyModule module = (RubyModule) value;
    if (module != this && module.getBaseName() == null) {
      module.setBaseName(name);
      module.setParent(this);
    }
    module.calculateName();
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_mod_const_set
 *
 */
@JRubyMethod(name = "const_set", required = 2)
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) {
  IRubyObject constant = setConstant(validateConstant(symbol.asJavaString()).intern(), value);
  if (constant instanceof RubyModule) {
    ((RubyModule)constant).calculateName();
  }
  return constant;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_mod_const_set
 *
 */
@JRubyMethod(name = "const_set", required = 2)
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) {
  IRubyObject constant = setConstant(validateConstant(symbol.asJavaString()).intern(), value);
  if (constant instanceof RubyModule) {
    ((RubyModule)constant).calculateName();
  }
  return constant;
}

相关文章

微信公众号

最新文章

更多

RubyModule类方法