use of org.jruby.RubyHash in project nokogiri by sparklemotion.
the class ReaderNode method getNamespaces.
public IRubyObject getNamespaces(ThreadContext context) {
final Ruby runtime = context.runtime;
if (namespaces == null)
return runtime.getNil();
RubyHash hash = RubyHash.newHash(runtime);
for (Map.Entry<String, String> entry : namespaces.entrySet()) {
IRubyObject k = stringOrBlank(runtime, entry.getKey());
IRubyObject v = stringOrBlank(runtime, entry.getValue());
// hash.op_aset(context, k, v)
hash.fastASetCheckString(runtime, k, v);
}
return hash;
}
Aggregations