1248件ヒット
[1201-1248件を表示]
(0.114秒)
クラス
-
ARGF
. class (262) - Array (24)
- BasicObject (72)
- Class (12)
- Hash (55)
- Integer (12)
- Method (117)
- Module (252)
- NameError (10)
- Object (120)
- OptionParser (144)
-
RubyVM
:: InstructionSequence (12) -
Thread
:: Backtrace :: Location (36) - TracePoint (12)
-
URI
:: Generic (24) - UnboundMethod (12)
-
WIN32OLE
_ TYPE (24)
モジュール
- Enumerable (48)
キーワード
- ! (12)
- != (12)
- < (12)
- << (7)
- <=> (12)
- == (12)
- === (8)
- >> (7)
- [] (12)
-
_ dump (12) -
absolute
_ path (12) -
append
_ features (12) - autoload (12)
-
base
_ label (12) - bind (12)
- bytes (14)
- call (24)
- chars (7)
-
class
_ eval (24) -
class
_ exec (12) - codepoints (14)
- component (12)
-
default
_ event _ sources (12) -
default
_ port (12) -
define
_ singleton _ method (24) -
defined
_ class (12) - display (12)
- each (36)
-
each
_ byte (24) -
each
_ char (12) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ line (36) - extend (12)
- getbyte (12)
- getc (12)
- inherited (12)
-
initialize
_ copy (12) - inspect (12)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) - lines (35)
-
marshal
_ load (12) - merge (24)
-
module
_ eval (24) -
module
_ exec (12) -
ole
_ type (12) - on (144)
-
prepend
_ features (12) -
pretty
_ print (12) -
private
_ class _ method (24) -
private
_ constant (12) -
public
_ class _ method (24) -
public
_ constant (12) - receiver (10)
-
remove
_ method (12) - replace (12)
-
set
_ encoding (36) -
singleton
_ class? (12) -
singleton
_ methods (12) -
sort
_ by (24) -
super
_ method (11) -
to
_ a (24) -
to
_ ary (12) -
to
_ bn (12) -
to
_ h (19) -
to
_ proc (12) -
to
_ s (24) - unbind (12)
-
undef
_ method (12)
検索結果
先頭5件
-
Hash
# replace(other) -> self (220.0) -
ハッシュの内容を other の内容で置き換えます。
...の内容を other の内容で置き換えます。
デフォルト値の設定もotherの内容になります。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
self = other.to_hash.dup と同じです。
@param other ハッシ......ド to_hash でハッシュに変換できるオブジェクトです。
@return self を返します。
//emlist[例][ruby]{
foo = {1 => 'a', 2 => 'b'}
bar = {2 => 'B', 3 => 'C'}
foo.replace(bar)
p foo #=> {2=>"B", 3=>"C"}
zoo = {}
zoo = bar.dup
p zoo #=> {2=>"B", 3=>"C"}
class Foo
def to_h......ash
{:japan => 'kyoto'}
end
end
h = Hash.new
h.replace(Foo.new) #暗黙の変換
p h #=> {:japan=>"kyoto"}
//}
@see Hash#dup,Hash#merge,Object#to_hash... -
Module
# <(other) -> bool | nil (157.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...比較演算子。self が other の子孫である場合、 true を返します。
self が other の先祖か同一のクラス/モジュールである場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較対象のモ......やクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux......# => nil
p Baz > Qux # => nil
p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}... -
Module
# <=>(other) -> Integer | nil (153.0) -
self と other の継承関係を比較します。
...
self と other の継承関係を比較します。
self と other を比較して、
self が other の子孫であるとき -1、
同一のクラス/モジュールのとき 0、
self が other の先祖であるとき 1
を返します。
継承関係にないクラス同士の比較では
n......il を返します。
other がクラスやモジュールでなければ
nil を返します。
@param other 比較対象のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar #......=> -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=> Object.new # => nil
//}... -
Hash
# merge(*others) -> Hash (146.0) -
selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。 デフォルト値はselfの設定のままです。
...
selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。
デフォルト値はselfの設定のままです。
self と others に同じキーがあった場合はブロック付きか否かで
判定方法が違います。ブロック付きのときはブ......常に others の値を使います。
othersがハッシュではない場合、othersのメソッドto_hashを使って暗黙の変換を試みます。
@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マ......ージした結果を返します
//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge #=> {"a"=>100, "b"=>200}
h1.merge(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1.merge(h2, h3) #=> {"a"=>100, "b"=>357, "c"=>300, "d... -
Hash
# merge(other) -> Hash (146.0) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
self と other に同じキーがあった場合はブロック付きか否かで
判定方法が違います。ブロック付きのときはブロックを......常に other の値を使います。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マー......ジした結果を返します
//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge() # => {"a"=>100, "b"=>200}
h1.merge(h2) # => {"a"=>100, "b"=>254, "c"=>300}
h1.merge(h2){|key, oldval, newval| newval - oldval}
# => {"a"=>100, "b"=>54, "... -
NameError
# receiver -> object (123.0) -
self が発生した時のレシーバオブジェクトを返します。
...
self が発生した時のレシーバオブジェクトを返します。
例:
class Sample
def foo
return "foo"
end
end
bar = Sample.new
begin
bar.bar
rescue NameError => err
p err.receiver # => #<Sample:0x007fd4d89b3110>
p err.receiver.foo # => "foo"
en...