38件ヒット
[1-38件を表示]
(0.023秒)
種類
- インスタンスメソッド (17)
- 特異メソッド (17)
- 文書 (4)
ライブラリ
- ビルトイン (12)
-
json
/ add / exception (22)
オブジェクト
- ENV (6)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) -
json
_ create (11) - slice (6)
-
to
_ json (11)
検索結果
先頭5件
-
Hash
# except(*keys) -> Hash (39242.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 (21129.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 (18236.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... -
Exception
. json _ create(hash) -> Exception (3207.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
...JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。... -
Exception
# to _ json(*args) -> String (3018.0) -
自身を JSON 形式の文字列に変換して返します。
...にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
re......scue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
ENV
. slice(*keys) -> Hash (129.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 (78.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* Dir
* 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
* E......cant overhead 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#n......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...