Top Inners Fields Constructors Methods
org.jruby

public Class RubyStruct

extends RubyObject
Class Inheritance
Annotations
@JRubyClass
name:Struct
Imports
java.util.HashSet, .Map, .Set, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.api.Create, org.jruby.common.IRubyWarnings.ID, org.jruby.exceptions.RaiseException, org.jruby.internal.runtime.methods.DynamicMethod, org.jruby.runtime.Arity, .Block, .CallSite, .ClassIndex, .Helpers, .JavaSites.StructSites, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.marshal.MarshalDumper, .MarshalLoader, org.jruby.util.ByteList, .RecursiveComparator, org.jruby.util.io.RubyInputStream, .RubyOutputStream

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
private static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
public static final String
private static final String
public static final String
public static final String
private static final String
private static final byte[]
private static final byte[]
public static final String
private final IRubyObject[]
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
private
RubyStruct(Ruby
the runtime
runtime
,
RubyClass
the class
rubyClass
)

Constructor for RubyStruct.

public
RubyStruct(ThreadContext context, RubyClass rubyClass)

Method Summary

Modifier and TypeMethod and Description
private static RubyArray<T extends IRubyObject>
private RubyArray<T extends IRubyObject>
public IRubyObject
aref(IRubyObject key)
Deprecated since 10.0.

public IRubyObject
pack-priv final IRubyObject
aref(int idx)
Deprecated since 10.0.

pack-priv final IRubyObject
aref(ThreadContext context, int originalIndex)

private IRubyObject
arefImpl(ThreadContext context, IRubyObject key, final boolean nilOnNoMember)

public IRubyObject
aset(IRubyObject key, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
private IRubyObject
aset(ThreadContext context, int originalIndex, IRubyObject value)

private void
checkForKeywords(ThreadContext context, boolean keywordInit)

private static void
checkIndexBounds(ThreadContext context, int i, int index, int length)

private void
checkSize(ThreadContext context, int length)

private RubyClass
public RubyBoolean
compare(ThreadContext context, CallSite site, IRubyObject other)

public void
public static RubyClass
createStructClass(ThreadContext context, RubyClass Object, RubyModule Enumerable)

public IRubyObject
public IRubyObject
dig(ThreadContext context, IRubyObject arg0)

public IRubyObject
public IRubyObject
public IRubyObject
dig(ThreadContext context, IRubyObject[] args)

public IRubyObject
each(final ThreadContext context, final Block block)

public IRubyObject
each_pair(final ThreadContext context, final Block block)

public IRubyObject
public IRubyObject
public IRubyObject
private static IRubyObject
extractKeywordArg(final ThreadContext context, final RubyHash options, String validKey)

public final IRubyObject
get(int index)

private IRubyObject
private static IRubyObject
getInternalVariable(ThreadContext context, RubyClass type, String internedName)

public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
initialize_copy(ThreadContext
the thread context
context
,
IRubyObject
the original
arg
)

Overrides org.jruby.RubyBasicObject.initialize_copy.

Initializes this object as a copy of the original, that is the parameter to this object.

public IRubyObject
initializeInternal(ThreadContext context, int provided, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)

public RubyString
inspect(final ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

private RubyString
inspectStruct(final ThreadContext context, final boolean recur)

inspect_struct

public static void
marshalTo(RubyStruct struct, MarshalStream output)
Deprecated for removal since 10.0.

public static void
pack-priv static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
members(IRubyObject recv, Block block)
Deprecated since 9.4-.

public RubyArray<T extends IRubyObject>
members()
Deprecated since 10.0.

public RubyArray<T extends IRubyObject>
private void
public static RubyClass
newInstance(IRubyObject recv, IRubyObject[] args, Block block)
Deprecated

public static RubyClass
newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

Create new Struct class.

public static RubyStruct
newStruct(IRubyObject recv, IRubyObject[] args, Block block)

Create new Structure.

public static RubyStruct
public static RubyStruct
public static RubyStruct
public static RubyStruct
private RaiseException
public IRubyObject
op_equal(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyBasicObject.op_equal.

Implements org.jruby.runtime.builtin.IRubyObject.op_equal.

rb_obj_equal Will by default use identity equality to compare objects.

pack-priv static RubyClass
public IRubyObject
select(ThreadContext context, Block block)

public IRubyObject
set(IRubyObject value, int index)
Deprecated since 10.0.

private IRubyObject
set(ThreadContext context, IRubyObject value, int index)

private IRubyObject
setByName(ThreadContext context, String name, IRubyObject value)

private IRubyObject
private static JavaSites.StructSites
sites(ThreadContext context)

Hides org.jruby.RubyObject.sites.

Retrieve the call sites for this class.

private static IRubyObject
size(ThreadContext context, RubyStruct recv, IRubyObject[] args)

A size method suitable for lambda method reference implementation of SizeFn#size(ThreadContext, IRubyObject, IRubyObject[])

public RubyFixnum
public RubyFixnum
size()
Deprecated

public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
to_a()

Overrides org.jruby.RubyBasicObject.to_a.

Deprecated since 9.4-.

public RubyHash
to_h(ThreadContext context)
Deprecated

public RubyHash
to_h(ThreadContext context, Block block)

public static IRubyObject
unmarshalFrom(UnmarshalStream input)
Deprecated for removal since 10.0.

public static IRubyObject
public IRubyObject
values_at(IRubyObject[] args)
Deprecated since 10.0.

public IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClasshashCodeinspectop_eqqputsspecificEvaltoRubyStringtoString