るりまサーチ

最速Rubyリファレンスマニュアル検索!
122件ヒット [1-100件を表示] (0.081秒)

別のキーワード

  1. psych psych_y
  2. kernel y
  3. kernel psych_y
  4. psych y
  5. y psych

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

YAML::DBM#replace(other) -> YAML::DBM (21202.0)

self の内容を other の内容で置き換えます。

self の内容を other の内容で置き換えます。

@param other Hash、DBM オブジェクトを指定します。

@raise DBMError 更新に失敗した場合に発生します。

自身を返します。

Array#replace(another) -> self (21108.0)

配列の内容を配列 another の内容で置き換えます。

...合は to_ary メソッドに
よる暗黙の型変換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3]
a.replace [4, 5, 6]...

SDBM#replace(other) -> self (18126.0)

self の内容を other の内容で置き換えます。

...'ddd'
hash = { 'x' => 'xxx', 'y' => 'yyy'}

p db1 #=> #<SDBM:0xb7c304d0>
p db1.to_hash #=> {"a"=>"aaa", "b"=>"bbb", "c"=>"ccc"}
p db1.replace(db2) #=> #<SDBM:0xb7c304d0>
p db1.to_hash #=> {"c"=>"ccc", "d"=>"ddd"}
p db1.replace(hash) #=> #<SDBM:0xb7c304d0>...
...p db1.to_hash #=> {"x"=>"xxx", "y"=>"yyy"}...

DBM#replace(other) -> self (18120.0)

self の内容を other の内容で置き換えます。

...6, DBM::NEWDB)
db2[:bb] = 'bbb'
db2[:cc] = 'ccc'

p db1.keys #=> ['b', 'a']

db1.replace(db2)

p db1.keys #=> ['bb', 'cc']
p db2.keys #=> ['bb', 'cc']

hash = {'x' => 'xxx', 'y' => 'yyy' }
p db1 #=> #<DBM:0xb7c7eb08>
p db1.replace(hash) #=> #<DBM:0xb7c7eb08>...

GDBM#replace(other) -> self (18120.0)

self の内容を other の内容で置き換えます。

...1['a'] = 'aaa'
db1['b'] = 'bbb'
db2 = GDBM.open('bbb.gdbm', 0666, GDBM::NEWDB)
db2['c'] = 'ccc'
db2['d'] = 'ddd'
hash = { 'x' => 'xxx', 'y' => 'yyy'}

p db1 #=> #<GDBM:0xb7d1c8a8>
p db1.replace(db2) #=> #<GDBM:0xb7d1c8a8>
p db1.replace(hash) #=> #<GDBM:0xb7d1c8a8>...

絞り込み条件を変える

Method#arity -> Integer (6119.0)

メソッドが受け付ける引数の数を返します。

...emlist[例][ruby]{
class C
def u; end
def v(a); end
def w(*a); end
def x(a, b); end
def y(a, b, *c); end
def z(a, b, *c, &d); end
end

c = C.new
p c.method(:u).arity #=> 0
p c.method(:v).arity #=> 1
p c.method(:w).arity #=> -1
p...
...c.method(:x).arity #=> 2
p c.method(:y).arity #=> -3
p c.method(:z).arity #=> -3

s = "xyz"
s.method(:size).arity #=> 0
s.method(:replace).arity #=> 1
s.method(:squeeze).arity #=> -1
s.method(:count).arity #=> -1
//}...

UnboundMethod#arity -> Integer (6107.0)

メソッドが受け付ける引数の数を返します。

...mlist[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end

p C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C....
...(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3


String.instance_method(:size).arity #=> 0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=> -1...

Rake::FileList#gsub(pattern, replace) -> Rake::FileList (114.0)

自身に含まれるファイルリストのそれぞれのエントリに対して String#gsub を実行し、 結果を新しい Rake::FileList として返します。

...自身に含まれるファイルリストのそれぞれのエントリに対して String#gsub を実行し、
結果を新しい Rake::FileList として返します。

例:
FileList['lib/test/file', 'x/y'].gsub(/\//, "\\") # => ['lib\\test\\file', 'x\\y']...

Hash#merge!(*others) {|key, self_val, other_val| ... } -> self (107.0)

selfとothersのハッシュの内容を順番にマージ(統合)します。

...クトです。
@return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge! #=> {"a"=>100, "b"=>200}
h1 #=> {"a"=>100, "b"=>200}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h1.merge!(h2...
...=>300}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b"...
..."c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) {|key, v1, v2| v1 }
#=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4...
<< 1 2 > >>