当前位置: 首页>>代码示例>>Java>>正文


Java RubyHash.get方法代码示例

本文整理汇总了Java中org.jruby.RubyHash.get方法的典型用法代码示例。如果您正苦于以下问题:Java RubyHash.get方法的具体用法?Java RubyHash.get怎么用?Java RubyHash.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jruby.RubyHash的用法示例。


在下文中一共展示了RubyHash.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyEnvironment

import org.jruby.RubyHash; //导入方法依赖的package包/类
/**
 * applyEnvironment
 * 
 * @param container
 */
protected void applyEnvironment()
{
	Ruby runtime = this.getRuntime();
	IRubyObject env = runtime.getObject().getConstant(ENV_PROPERTY);

	if (env != null && env instanceof RubyHash)
	{
		RubyHash hash = (RubyHash) env;

		// save copy for later
		this._originalEnvironment = (RubyHash) hash.dup();

		hash.putAll(this.getContributedEnvironment());

		// Grab all the matching env objects contributed via bundles that have scope matching!
		IModelFilter filter = new ScopeFilter((String) hash.get("TM_CURRENT_SCOPE")); //$NON-NLS-1$
		List<EnvironmentElement> envs = BundleManager.getInstance().getEnvs(filter);
		ScopeSelector.sort(envs);
		for (EnvironmentElement e : envs)
		{
			RubyProc invoke = e.getInvokeBlock();
			if (invoke != null)
			{
				invoke.call(runtime.getCurrentContext(), new IRubyObject[] { hash });
			}
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:34,代码来源:CommandBlockRunner.java

示例2: setHashParameters

import org.jruby.RubyHash; //导入方法依赖的package包/类
private void setHashParameters(Transformer transformer, RubyHash hash) {
    Set<String> keys = hash.keySet();
    for (String key : keys) {
        String value = (String)hash.get(key);
        transformer.setParameter(key, unparseValue(value));
    }
}
 
开发者ID:gocd,项目名称:gocd,代码行数:8,代码来源:XsltStylesheet.java

示例3: getStringFromHash

import org.jruby.RubyHash; //导入方法依赖的package包/类
public static String getStringFromHash(RubyHash target, String key) {
    try {
        Object value = target.get(key);
        if (value != null)
            return value.toString();
        return null;
    } catch (Exception e) {
        return null;
    }
}
 
开发者ID:vishnukarthikl,项目名称:calabash-android-java,代码行数:11,代码来源:Utils.java

示例4: toJavaHash

import org.jruby.RubyHash; //导入方法依赖的package包/类
public static Map<?, ?> toJavaHash(RubyHash rubyHash) {
    HashMap<Object, Object> map = new HashMap<Object, Object>();
    Set<?> keySet = rubyHash.keySet();
    for (Object rubyKey : keySet) {
        Object rubyValue = rubyHash.get(rubyKey);
        Object javaKey = toJavaObject(rubyKey);
        Object javaValue = toJavaObject(rubyValue);
        map.put(javaKey, javaValue);
    }
    return map;
}
 
开发者ID:vishnukarthikl,项目名称:calabash-android-java,代码行数:12,代码来源:Utils.java

示例5: performCalabashAction

import org.jruby.RubyHash; //导入方法依赖的package包/类
/**
 * call calabash's perform_action function with action and its corresponding args
 * eg:
 * performCalabashAction("click_on_screen","50","100");
 *
 * @param action action to be performed
 * @param args   list of arguments for the action
 * @throws CalabashException
 */
public ActionResult performCalabashAction(String action, String... args) throws CalabashException {
    final RubyHash rubyResult = calabashWrapper.performAction(action, args);
    final RubyArray bonusInformationArray = (RubyArray) rubyResult.get("bonusInformation");
    final String message = rubyResult.get("message").toString();
    final boolean success = Boolean.parseBoolean(rubyResult.get("success").toString());
    final Object[] bonusInformation = Utils.toJavaArray(bonusInformationArray);
    return new ActionResult(bonusInformation, message, success);
}
 
开发者ID:vishnukarthikl,项目名称:calabash-android-java,代码行数:18,代码来源:AndroidApplication.java


注:本文中的org.jruby.RubyHash.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。