11334件ヒット
[1-100件を表示]
(0.179秒)
クラス
-
ARGF
. class (368) - Array (1359)
- BasicObject (33)
- Bignum (45)
- Binding (10)
- Class (33)
- Complex (13)
- Data (6)
- Dir (339)
- Encoding (33)
-
Encoding
:: Converter (33) - Enumerator (122)
-
Enumerator
:: ArithmeticSequence (53) -
Enumerator
:: Chain (18) -
Enumerator
:: Lazy (331) -
Enumerator
:: Yielder (27) - Exception (33)
- FalseClass (11)
- Fiber (14)
- File (209)
-
File
:: Stat (110) - Fixnum (39)
- Float (106)
- Hash (615)
- IO (1016)
- Integer (128)
- LoadError (11)
- MatchData (81)
- Method (32)
- Module (280)
- NilClass (11)
- Numeric (173)
- Object (125)
-
ObjectSpace
:: WeakMap (11) - Proc (74)
-
Process
:: Status (33) - Random (55)
- Range (200)
- Rational (132)
- Regexp (143)
-
RubyVM
:: InstructionSequence (33) - String (988)
- Struct (129)
- Symbol (151)
- SystemCallError (11)
- Thread (172)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: Queue (63) -
Thread
:: SizedQueue (36) - Time (22)
- TracePoint (150)
- TrueClass (11)
- UnboundMethod (32)
モジュール
- Enumerable (1206)
- FileTest (44)
-
GC
:: Profiler (11) - Kernel (945)
- Marshal (22)
- Math (11)
- ObjectSpace (66)
- Process (150)
- Signal (33)
キーワード
-
$ ! (11) -
$ & (11) -
$ & # 39; (11) -
$ + (11) -
$ , (11) -
$ -0 (11) -
$ -F (11) -
$ -W (11) -
$ -i (11) -
$ -v (11) -
$ -w (11) -
$ / (11) -
$ 1 (11) -
$ 10 (11) -
$ 11 (11) -
$ 2 (11) -
$ 3 (11) -
$ 4 (11) -
$ 5 (11) -
$ 6 (11) -
$ 7 (11) -
$ 8 (11) -
$ 9 (11) -
$ ; (11) -
$ ? (11) -
$ @ (11) -
$ VERBOSE (11) -
$ \ (11) -
$ _ (11) -
$ ` (11) -
$ ~ (11) - % (18)
- & (6)
- * (17)
- ** (17)
- + (17)
- +@ (9)
- - (17)
- -@ (9)
-
/ (17) - < (11)
- << (17)
- <= (11)
- <=> (129)
- == (22)
- =~ (33)
- > (11)
- >= (11)
- >> (6)
-
ALT
_ SEPARATOR (11) -
CLOCK
_ MONOTONIC (11) -
CLOCK
_ PROCESS _ CPUTIME _ ID (11) -
CLOCK
_ REALTIME (11) - Complex (12)
- ConditionVariable (9)
- DATA (11)
- Fiber (11)
- Float (6)
- Integer (6)
- Lazy (11)
- Location (11)
- Method (11)
- Numeric (11)
-
PATH
_ SEPARATOR (11) - Queue (9)
- Range (11)
- Rational (6)
- Status (11)
- ThreadGroup (11)
- TracePoint (11)
- [] (230)
- ^ (6)
-
_ _ callee _ _ (11) -
_ _ dir _ _ (11) -
_ _ method _ _ (11) -
absolute
_ path (22) -
add
_ trace _ func (11) - advise (11)
- all? (41)
- angle (22)
- any? (46)
-
append
_ features (11) - arg (22)
- arity (11)
-
asciicompat
_ encoding (22) - assoc (33)
- at (11)
-
at
_ exit (11) - atime (11)
- autoclose? (11)
- autoload? (22)
- backtrace (11)
-
backtrace
_ locations (22) -
base
_ label (11) - begin (16)
- binding (11)
- binmode (11)
- binread (11)
- binwrite (11)
- blockdev? (22)
- bsearch (44)
-
bsearch
_ index (18) - byteindex (2)
- byteoffset (4)
- byterindex (2)
- bytes (50)
- byteslice (33)
-
callee
_ id (11) - caller (33)
-
caller
_ locations (22) - capitalize! (11)
- casecmp (22)
- casecmp? (16)
- catch (22)
- cause (11)
- ceil (23)
- chardev? (22)
- chars (50)
- chdir (22)
- children (6)
- chomp! (11)
- chop! (11)
- chown (11)
- chr (11)
- chunk (33)
-
chunk
_ while (19) -
class
_ eval (22) -
class
_ exec (11) - clear (9)
-
clock
_ gettime (11) - clone (11)
- close (9)
-
close
_ read (11) -
close
_ write (11) - closed? (9)
- codepoints (50)
- collect (55)
- collect! (22)
-
collect
_ concat (33) - combination (22)
- compact! (19)
- compatible? (11)
- compile (11)
- count (66)
- ctime (11)
- cycle (44)
- dedup (2)
- default (22)
-
default
_ internal (11) -
default
_ proc (11) -
default
_ proc= (11) - define (4)
-
define
_ finalizer (22) -
defined
_ class (11) - delete (66)
- delete! (11)
-
delete
_ at (11) -
delete
_ if (66) -
delete
_ prefix! (7) -
delete
_ suffix! (7) - deq (18)
- detect (22)
- dig (27)
- disasm (11)
- disassemble (11)
- div (6)
- downcase! (11)
- downto (22)
-
drop
_ while (55) - dup (11)
- each (310)
-
each
_ byte (66) -
each
_ char (66) -
each
_ child (40) -
each
_ codepoint (66) -
each
_ cons (22) -
each
_ entry (22) -
each
_ grapheme _ cluster (14) -
each
_ index (22) -
each
_ key (44) -
each
_ line (132) -
each
_ object (44) -
each
_ pair (66) -
each
_ slice (22) -
each
_ value (44) -
each
_ with _ index (22) -
each
_ with _ object (22) - eager (5)
- empty? (8)
- encode (33)
- end (17)
-
enum
_ for (44) - eof (11)
- eof? (11)
- errno (11)
-
eval
_ script (6) - event (11)
- exec (55)
- exitstatus (11)
-
extend
_ object (11) -
external
_ encoding (11) - fcntl (11)
- fdiv (17)
- fetch (106)
-
fetch
_ values (18) - fileno (10)
- fill (66)
- filter (66)
- filter! (36)
-
filter
_ map (15) - find (22)
-
find
_ all (33) -
find
_ index (66) - first (45)
-
flat
_ map (33) - flatten (11)
- flatten! (11)
- flock (11)
- floor (24)
- flush (11)
- fnmatch (11)
- fnmatch? (11)
-
for
_ fd (11) - foreach (66)
- fork (55)
- gamma (11)
- getbyte (33)
- getc (22)
- getrlimit (11)
- gets (77)
- glob (22)
-
grapheme
_ clusters (14) - grep (33)
-
grep
_ v (31) -
group
_ by (22) - gsub (77)
- gsub! (44)
- home (22)
- index (51)
- infinite? (19)
- inject (33)
-
inplace
_ mode (11) -
inplace
_ mode= (11) - inspect (44)
-
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ variable _ get (11) -
instruction
_ sequence (6) -
internal
_ encoding (22) - invert (11)
- join (22)
-
keep
_ if (66) - key (11)
-
keyword
_ init? (3) - lambda (17)
- lambda? (11)
- last (23)
-
last
_ error (11) -
last
_ match (22) -
last
_ status (7) - lazy (11)
- length (9)
- lineno (11)
- lines (106)
- load (11)
-
local
_ variables (10) -
locale
_ charmap (11) - loop (22)
- lstat (11)
- lstrip! (11)
- magnitude (6)
- map (55)
- map! (22)
- match (55)
- max (102)
-
max
_ by (44) - merge (22)
- merge! (32)
-
method
_ id (11) - min (102)
-
min
_ by (44) - minmax (42)
-
minmax
_ by (22) -
module
_ eval (22) -
module
_ exec (11) -
module
_ function (12) - modulo (6)
- mtime (11)
- name (11)
- new (278)
- none? (47)
- nonzero? (11)
- offset (22)
- one? (47)
- open (110)
- owner (22)
- p (11)
- pack (19)
- parameters (6)
- partition (22)
- pass (11)
- path (33)
- permutation (22)
- phase (22)
- pid (11)
- pipe (88)
- pop (29)
- popen (154)
- pos (22)
- pread (7)
- private (32)
- proc (18)
- produce (5)
- product (22)
- protected (16)
- public (28)
- pwrite (7)
- quo (22)
-
raised
_ exception (11) - rand (77)
- rassoc (22)
-
raw
_ data (11) - read (66)
-
read
_ nonblock (20) - readbyte (11)
- readlines (33)
- reduce (33)
- reject (99)
- reject! (66)
- remainder (14)
-
repeated
_ combination (22) -
repeated
_ permutation (22) -
respond
_ to? (11) - restore (11)
-
return
_ value (11) -
reverse
_ each (44) - rewind (11)
- rindex (44)
- round (34)
- rstrip! (11)
- sample (44)
- scan (22)
- scrub (33)
- scrub! (33)
- seek (11)
- select (143)
- select! (66)
-
set
_ backtrace (11) -
set
_ encoding _ by _ bom (5) -
set
_ trace _ func (22) - setgid? (11)
- setuid? (11)
- shift (51)
- signame (11)
- size (54)
- size? (33)
- slice (154)
- slice! (33)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - socket? (11)
- sort (44)
- sort! (22)
-
sort
_ by (22) -
sort
_ by! (22) - source (11)
-
source
_ location (33) - spawn (44)
- split (12)
- squeeze! (11)
- start (11)
- stat (11)
- status (11)
- step (112)
- sticky? (11)
- stopsig (11)
- strip! (11)
- sub (55)
- sub! (33)
- subsec (11)
- sum (49)
-
super
_ method (20) - superclass (11)
- swapcase! (11)
- sysseek (11)
- system (44)
- syswrite (11)
-
take
_ while (66) - tap (11)
- tell (22)
- termsig (11)
- test (22)
- then (12)
-
thread
_ variable _ get (11) - times (22)
-
to
_ enum (44) -
to
_ h (49) -
to
_ i (19) -
to
_ path (11) -
to
_ proc (5) -
to
_ s (33) - tr! (11)
-
tr
_ s! (11) - trace (11)
-
trace
_ var (33) - transfer (3)
-
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - trap (44)
- truncate (34)
-
try
_ convert (58) - union (11)
- uniq (49)
- uniq! (22)
- unpack (11)
-
untrace
_ var (11) - upcase! (11)
- update (44)
- upto (33)
- value (11)
- wait (11)
- wait2 (11)
- waitall (11)
- waitpid (11)
- waitpid2 (11)
-
with
_ index (32) -
with
_ object (22) -
world
_ readable? (33) -
world
_ writable? (11) - write (11)
-
write
_ nonblock (11) - yield (22)
-
yield
_ self (14) - zip (44)
- ~ (11)
検索結果
先頭5件
-
Integer
# |(other) -> Integer (29314.0) -
ビット二項演算子。論理和を計算します。
...ビット二項演算子。論理和を計算します。
@param other 数値
//emlist[][ruby]{
1 | 1 # => 1
2 | 3 # => 3
//}... -
FalseClass
# |(other) -> bool (29244.0) -
other が真なら true を, 偽なら false を返します。
...other が真なら true を, 偽なら false を返します。
@param other 論理和を行なう式です。
| は再定義可能な演算子に分類されていますので、通常は false | other の形で使われます。
//emlist[例][ruby]{
p false | true #=> true
p false | false......#=> false
p false | nil #=> false
p false | (1 == 1) #=> true
p false | (1 + 1) #=> true
p false.|(true) #=> true
p false.|(false) #=> false
p false.|(nil) #=> false
p false.|(1 == 1) #=> true
p false.|(1 + 1) #=> true
//}... -
TrueClass
# |(other) -> bool (29244.0) -
常に true を返します。
...true を返します。
@param other 論理和を行なう式です。
| は再定義可能な演算子に分類されていますので、通常は true | other のように使われます。
//emlist[例][ruby]{
p true | true #=> true
p true | false #=> true
p true | nil #=> true
p......true | (1 == 1) #=> true
p true | (1 + 1) #=> true
p true.|(true) #=> true
p true.|(false) #=> true
p true.|(nil) #=> true
p true.|(1 == 1) #=> true
p true.|(1 + 1) #=> true
//}... -
NilClass
# |(other) -> bool (26226.0) -
other が真なら true を, 偽なら false を返します。
...other が真なら true を, 偽なら false を返します。
@param other 論理和を行なう式です
//emlist[例][ruby]{
nil | true # => true
nil | false # => false
nil | nil # => false
nil | "a" # => true
//}... -
Bignum
# |(other) -> Fixnum | Bignum (26215.0) -
ビット二項演算子。論理和を計算します。
...ビット二項演算子。論理和を計算します。
@param other 数値
1 | 1 #=> 1
2 | 3 #=> 3... -
Fixnum
# |(other) -> Fixnum | Bignum (26215.0) -
ビット二項演算子。論理和を計算します。
...ビット二項演算子。論理和を計算します。
@param other 数値
1 | 1 #=> 1
2 | 3 #=> 3... -
Array
# |(other) -> Array (26208.0) -
集合の和演算です。両方の配列にいずれかに含まれる要素を全て含む新し い配列を返します。重複する要素は取り除かれます。
...する要素は取り除かれます。
要素の重複判定は、Object#eql? と Object#hash により行われます。
新しい配列における要素の順は self における要素の順と同じです。
@param other 配列を指定します。
配列以外のオブジェ......る暗黙の型変換を試みます。
@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
[1, 1, 4, 2, 3] | [5, 4, 5] #=> [1, 4, 2, 3, 5]
//}
@see Array#&......暗黙の型変換を試みます。
@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
[1, 1, 4, 2, 3] | [5, 4, 5] #=> [1, 4, 2, 3, 5]
//}
@see Array#&
@see Array#union... -
Enumerator
:: ArithmeticSequence # end -> Numeric | nil (20203.0) -
末項(終端)を返します。
...末項(終端)を返します。
@see Enumerator::ArithmeticSequence#begin... -
Encoding
:: Converter . asciicompat _ encoding(encoding) -> Encoding | nil (17404.0) -
同じ文字集合を持つ ASCII 互換エンコーディングを返します。
...集合を持つ ASCII 互換エンコーディングを返します。
@param string エンコーディング名
@param encoding エンコーディングオブジェクト
@return ASCII 互換エンコーディングのオブジェクトか nil
引数とエンコーディングと同じ文字集......ングでない場合は nil を返します。
//emlist[][ruby]{
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
//}... -
Object
# yield _ self {|x| . . . } -> object (17328.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}
値をメソッドチェインのパイプラインに次々と渡すの......方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返しま......す。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}
@see Object#tap......self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すの... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (17322.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given......do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで、repeat... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (17322.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given......do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで、repeat...