⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Array
/
View File Name :
rotate-i.ri
U:RDoc::AnyMethod[iI"rotate:ETI"Array#rotate;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I";Returns a new \Array formed from +self+ with elements ;TI"'rotated from one end to the other.;To:RDoc::Markup::BlankLine o; ; [I"GWhen no argument given, returns a new \Array that is like +self+, ;TI"Iexcept that the first element has been rotated to the last position:;To:RDoc::Markup::Verbatim; [I"!a = [:foo, 'bar', 2, 'bar'] ;TI"a1 = a.rotate ;TI"%a1 # => ["bar", 2, "bar", :foo] ;T:@format0o; ; [I"1When given a non-negative \Integer +count+, ;TI"Vreturns a new \Array with +count+ elements rotated from the beginning to the end:;To;; [I"a = [:foo, 'bar', 2] ;TI"a1 = a.rotate(2) ;TI"a1 # => [2, :foo, "bar"] ;T; 0o; ; [I"HIf +count+ is large, uses
count % array.size
as the count:;To;; [I"a = [:foo, 'bar', 2] ;TI"a1 = a.rotate(20) ;TI"a1 # => [2, :foo, "bar"] ;T; 0o; ; [I">If +count+ is zero, returns a copy of +self+, unmodified:;To;; [I"a = [:foo, 'bar', 2] ;TI"a1 = a.rotate(0) ;TI"a1 # => [:foo, "bar", 2] ;T; 0o; ; [I"PWhen given a negative \Integer +count+, rotates in the opposite direction, ;TI"from end to beginning:;To;; [I"a = [:foo, 'bar', 2] ;TI"a1 = a.rotate(-2) ;TI"a1 # => ["bar", 2, :foo] ;T; 0o; ; [I"XIf +count+ is small (far from zero), uses
count % array.size
as the count:;To;; [I"a = [:foo, 'bar', 2] ;TI"a1 = a.rotate(-5) ;TI"a1 # => ["bar", 2, :foo];T; 0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"@array.rotate -> new_array array.rotate(count) -> new_array ;T0[ I"(*args);T@CFI" Array;TcRDoc::NormalClass00