るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Module#ruby2_keywords(method_name, ...) -> nil (24563.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
key
word splat. It marks the method such that if the method is called
with keyword arguments, the final hash arg...
...licit
key
words or a keyword splat, the final element is interpreted as
key
words. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before...
...2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
b
efore 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will...

Proc#ruby2_keywords -> proc (24563.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
b
ut not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked...
...xplicit keywords or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
b
e passed through the proc to other methods.

This should only be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before...
...2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
b
efore 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
proc will chang...

Hash#key(val) -> object (18332.0)

値 val に対応するキーを返します。対応する要素が存在しない時には nil を返します。

...Hash#index は obsolete です。
使用すると警告メッセージが表示されます。

@param val 探索に用いる値を指定します。

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all" , :ef => "all"}

p h.key("some") #=> :ab
p h.key("all") #=> :cd
p h.key("at") #=> nil
//}

@...
...キーが複数存在する場合、どのキーを返すかは不定です。


@param val 探索に用いる値を指定します。

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all" , :ef => "all"}

p h.key("some") #=> :ab
p h.key("all") #=> :cd
p h.key("at") #=> nil
//}

@see Hash#invert...

Net::HTTPHeader#key?(key) -> bool (6477.0)

key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。

...key というヘッダフィールドがあれば真を返します。
key
は大文字小文字を区別しません。

@param key 探すヘッダフィールド名を文字列で与えます。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
res = Ne...
...t::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-header') # => false
//}...

Hash#has_key?(key) -> bool (6453.0)

ハッシュが key をキーとして持つ時真を返します。

...ハッシュが key をキーとして持つ時真を返します。

@param key 探索するキーを指定します。

//emlist[][ruby]{
p({1 => "one"}.key?(1)) # => true
p({1 => "one"}.key?(2)) # => false
//}

@see Hash#value?...

絞り込み条件を変える

Hash#key?(key) -> bool (6453.0)

ハッシュが key をキーとして持つ時真を返します。

...ハッシュが key をキーとして持つ時真を返します。

@param key 探索するキーを指定します。

//emlist[][ruby]{
p({1 => "one"}.key?(1)) # => true
p({1 => "one"}.key?(2)) # => false
//}

@see Hash#value?...

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (6442.0)

要素から key という属性名の属性を削除します。

...要素から key という属性名の属性を削除します。

削除された属性を返します。

key
という属性名の属性が存在しない場合は削除されずに、nil を返します。

@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)...
...//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x"); e # => <E y:x='bar'/>
//}...

Hash#each_key {|key| ... } -> self (6358.0)

ハッシュのキーを引数としてブロックを評価します。

...れた順です。
ブロック付きの場合selfを、
無しで呼ばれた場合Enumeratorを返します。

//emlist[例][ruby]{
{:a=>1, :b=>2}.each_key {|k| p k}
#=> :a
# :b

p({:a=>1, :b=>2}.each_key) # => #<Enumerator: {:a=>1, :b=>2}:each_key>
//}

@see Hash#each_pair,Hash#each_value...

REXML::Element#add_attribute(key, value) -> () (6356.0)

要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...ibute オブジェクトを
渡す方法です。

文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)

//emlist[][ruby]...
...{
require 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c' b='d'/>
//}...
<< 1 2 3 ... > >>