public static object CreateArray(BlockParam block, RubyClass /*!*/ self, [NotNull] object /*!*/ arrayOrSize) { IList array = Protocols.AsArray(self.Context, arrayOrSize); if (array != null) { // block ignored return(CreateArray(array)); } int size = Protocols.CastToFixnum(self.Context, arrayOrSize); if (block != null) { return(CreateArray(block, size)); } else { return(CreateArray(self, size, null)); } }
public static object Reinitialize(RubyContext /*!*/ context, BlockParam block, RubyArray /*!*/ self, [NotNull] object /*!*/ arrayOrSize) { RubyUtils.RequiresNotFrozen(context, self); IList array = Protocols.AsArray(context, arrayOrSize); if (array != null) { // block ignored return(Reinitialize(self, array)); } int size = Protocols.CastToFixnum(context, arrayOrSize); if (block != null) { return(Reinitialize(block, self, size)); } else { return(ReinitializeByRepeatedValue(context, self, size, null)); } }