723件ヒット
[1-100件を表示]
(0.125秒)
ライブラリ
クラス
- Array (128)
- BasicObject (44)
- CSV (11)
- Enumerator (7)
-
Enumerator
:: Lazy (10) - Object (33)
- Pathname (11)
- Prime (11)
- Range (79)
-
Rinda
:: DRbObjectTemplate (11) - SDBM (11)
- Set (22)
- String (11)
- Time (22)
モジュール
- Enumerable (160)
- GC (11)
- ObjectSpace (11)
-
Process
:: GID (11) -
Process
:: UID (11)
オブジェクト
- ENV (22)
キーワード
- != (11)
- === (22)
-
NEWS for Ruby 2
. 3 . 0 (9) - NKF (11)
- Ruby用語集 (11)
-
_ _ id _ _ (11) - bigdecimal (11)
-
chunk
_ while (11) - count (22)
- delete (11)
- detect (11)
- divide (22)
- each (11)
- equal? (11)
- filter (6)
- find (11)
-
find
_ all (11) -
find
_ index (11) - getlocal (22)
- hash (11)
- include? (5)
- instance (11)
- itself (11)
- join (11)
-
latest
_ gc _ info (11) - max (60)
-
memsize
_ of _ all (11) - min (80)
- minmax (10)
- new (7)
- pack (19)
- pack テンプレート文字列 (11)
- partition (11)
- rassoc (11)
-
rb
_ f _ require (11) - reject (44)
- reject! (55)
-
ruby 1
. 6 feature (11) - select (11)
-
slice
_ when (10) - switch (22)
- unpack (11)
- 制御構造 (11)
検索結果
先頭5件
-
BasicObject
# ==(other) -> bool (24112.0) -
オブジェクトが other と等しければ真を、さもなくば偽を返します。
...ォルトでは Object#equal? と同じオブジェクトの同一性になっています。
@param other 比較対象となるオブジェクト
@return other が self と同値であれば真、さもなくば偽
//emlist[例][ruby]{
class Person < BasicObject
def initialize(name, age)
@n......ame = name
@age = age
end
end
tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)
tanaka1 == tanaka1 #=> true
tanaka1 == tanaka2 #=> false
//}
@see BasicObject#equal?, Object#==, Object#equal?,
Object#eql?... -
Rinda
:: DRbObjectTemplate # ===(ro) (18200.0) -
@todo
...@todo
This DRbObjectTemplate matches +ro+ if the remote object's drburi
and drbref are the same. +nil+ is used as a wildcard.... -
Object
# ===(other) -> bool (15206.0) -
case 式で使用されるメソッドです。d:spec/control#case も参照してください。
...Object#== を呼び出します。
when 節の式をレシーバーとして === を呼び出すことに注意してください。
また Enumerable#grep でも使用されます。
@param other 比較するオブジェクトです。
//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===(12......aby"
when 3 .. 6
"little child"
when 7 .. 12
"child"
when 13 .. 18
"youth"
else
"adult"
end
puts result #=> "child"
def check arg
case arg
when /ruby(?!\s*on\s*rails)/i
"hit! #{arg}"
when String
"Instance of String class. But don't hit."
else
"unknown"......end
end
puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}
@see Object#==, Range#===, Module#===, Regexp#===, Enumerable#grep... -
Enumerable
# find _ index {|obj| . . . } -> Integer | nil (12466.0) -
条件に一致する最初の要素の位置を返します。
...トを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
(1..10).find_index(11) #=> nil
(1..10).find_index(2) #=> 1
//}
ブロックが与えられ......の位置を返します。
一つも真にならなかった場合は nil を返します。
//emlist[例][ruby]{
(1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
//}
引数、ブロックのどちらも与えられなか... -
Pathname
# join(*args) -> Pathname (12206.0) -
与えられたパス名を連結します。
...list[例][ruby]{
require "pathname"
path0 = Pathname("/usr") # Pathname:/usr
path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
# 上記の path0 の処理は下記の path1 と同様のパスになります
path1 = Pathname("/usr") + "bin/ruby" # Pathname:/usr/bi......n/ruby
path0 == path1 #=> true
//}... -
Object
# itself -> object (9206.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
string = 'my string' # => "my string"
string.itself.object_id == string.object_id # => true
//}... -
Range
# include?(obj) -> bool (9200.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...obj が範囲内に含まれている時に true を返します。
そうでない場合は、false を返します。
Range#=== は主に case 式での比較に用いられます。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用して......します。
@param obj 比較対象のオブジェクトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true... -
BasicObject
# _ _ id _ _ -> Integer (9130.0) -
各オブジェクトに対して一意な整数を返します。あるオブジェクトに対し てどのような整数が割り当てられるかは不定です。
...Object#object_id と同じですが、#object_id は BasicObject に
はない事に注意してください。
//emlist[例][ruby]{
# frozen_string_literal: false
obj = Object.new
obj.object_id == obj.__id__ # => true
Object.new.__id__ == Object.new.__id__ # => false
(21 * 2).__id_......_ == (21 * 2).__id__ # => true
"hello".__id__ == "hello".__id__ # => false
"hi".freeze.__id__ == "hi".freeze.__id__ # => true
//}
@see Object#object_id, 42840... -
ObjectSpace
. # memsize _ of _ all(klass = nil) -> Integer (9106.0) -
すべての生存しているオブジェクトが消費しているメモリ使用量をバイト単位 で返します。
...ドは以下のような Ruby のコードで定義できます。
//emlist[例][ruby]{
def memsize_of_all klass = false
total = 0
ObjectSpace.each_object{|e|
total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass)
}
total
end
//}
戻り値の内容は完全ではな... -
Enumerable
# partition {|item| . . . } -> [[object] , [object]] (6418.0) -
各要素を、ブロックの条件を満たす要素と満たさない要素に分割します。 各要素に対してブロックを評価して、その値が真であった要素の配列と、 偽であった要素の配列の 2 つを配列に入れて返します。
...要素の配列と、
偽であった要素の配列の 2 つを配列に入れて返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0].partition {|i| i % 3 == 0 }
#=> [[9, 6, 3, 0], [10, 8, 7, 5, 4, 2, 1]]
//}...