種類
- インスタンスメソッド (6)
- 特異メソッド (6)
- 文書 (4)
ライブラリ
- ビルトイン (12)
クラス
- Hash (6)
オブジェクト
- ENV (6)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - slice (6)
検索結果
先頭5件
-
Hash
# except(*keys) -> Hash (39343.0) -
引数で指定された以外のキーとその値だけを含む Hash を返します。
...引数で指定された以外のキーとその値だけを含む Hash を返します。
引数に指定されていて Hash に存在しないキーは無視されます。
//emlist[][ruby]{
h = { a: 100, b: 200, c: 300 }
h.except(:a) # => {:b=>200, :c=>300}
//}
@see Hash#slice, ENV.except... -
Hash
# slice(*keys) -> Hash (21230.0) -
引数で指定されたキーとその値だけを含む Hash を返します。
...引数で指定されたキーとその値だけを含む Hash を返します。
//emlist[例][ruby]{
h = { a: 100, b: 200, c: 300 }
h.slice(:a) # => {:a=>100}
h.slice(:c, :b) # => {:c=>300, :b=>200}
h.slice(:b, :c, :d) # => {:b=>200, :c=>300}
//}
@see Hash#except, ENV.slice... -
ENV
. except(*keys) -> Hash (18337.0) -
引数で指定された以外のキーとその値だけを含む Hash を返します。
...引数で指定された以外のキーとその値だけを含む Hash を返します。
//emlist[][ruby]{
ENV #=> {"LANG"=>"en_US.UTF-8", "TERM"=>"xterm-256color", "HOME"=>"/Users/rhc"}
ENV.except("TERM","HOME") #=> {"LANG"=>"en_US.UTF-8"}
//}
@see Hash#except, ENV.slice... -
ENV
. slice(*keys) -> Hash (230.0) -
引数で指定されたキーとその値だけを含む Hash を返します。
...を含む Hash を返します。
//emlist[例][ruby]{
ENV["foo"] = "bar"
ENV["baz"] = "qux"
ENV["bar"] = "rab"
ENV.slice() # => {}
ENV.slice("") # => {}
ENV.slice("unknown") # => {}
ENV.slice("foo", "baz") # => {"foo"=>"bar", "baz"=>"qux"}
//}
@see Hash#slice, ENV.except... -
NEWS for Ruby 3
. 0 . 0 (114.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
*......d to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#nonblock? now......n added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take the request headers as a Hash in the second argument when the first argument is a URI. 16686
* Net::SMTP
* Add SNI support.
* Net::SMTP.start arguments are keyword a...