374件ヒット
[1-100件を表示]
(0.088秒)
種類
- インスタンスメソッド (253)
- モジュール関数 (55)
- 特異メソッド (55)
- 文書 (11)
クラス
-
CSV
:: Row (11) - DBM (22)
- GDBM (22)
- Hash (121)
-
JSON
:: State (22) - Object (11)
-
Rake
:: TaskArguments (22) - SDBM (44)
-
YAML
:: DBM (11)
オブジェクト
- ENV (22)
キーワード
- Hash (11)
-
NEWS for Ruby 2
. 0 . 0 (11) - [] (22)
- generate (11)
- merge (22)
- merge! (22)
-
pretty
_ generate (11) -
pretty
_ unparse (11) - reject (33)
- replace (33)
-
to
_ h (11) -
try
_ convert (11) - unparse (11)
- update (33)
-
with
_ defaults (11)
検索結果
先頭5件
-
Hash
# to _ hash -> self (18219.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}
@see Object#to_hash, Hash#to_h... -
CSV
:: Row # to _ hash -> Hash (18207.0) -
自身をシンプルなハッシュに変換します。
...プルなハッシュに変換します。
フィールドの順序は無視されます。
重複したフィールドは削除されます。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header2", "header1", "header2"], [1, 2, 3])
row.to_hash # => {"header2"=>3, "header1"=>2}
//}... -
DBM
# to _ hash -> Hash (18207.0) -
self をハッシュに変換して返します。
...self をハッシュに変換して返します。
require 'dbm'
db1 = DBM.open('aaa.db', 0666, DBM::NEWDB)
db1[:a] = 'aaa'
db1[:b] = 'bbbbbb'
p db1.to_hash #=> {"a"=>"aaa", "b"=>"bbbbbb"}... -
Object
# to _ hash -> Hash (18207.0) -
オブジェクトの Hash への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...すべての場面で代置可能であるような、
* ハッシュそのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_hash
{'as' => 24}
end
end
it = Foo.new
p({:as => 12}.merge(it)) #=> {"as"=>24, :as=>12}
//}... -
Rake
:: TaskArguments # to _ hash -> Hash (18207.0) -
パラメータ名と対応する値を格納したハッシュを返します。
...納したハッシュを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash # => {:name1=>"value1", :name2=>"value2"}
end
//}... -
SDBM
# to _ hash -> Hash (18207.0) -
self の各要素を格納したハッシュを返します。
...self の各要素を格納したハッシュを返します。
require 'sdbm'
db1 = SDBM.open('aaa.gdbm', 0666)
db1.clear
db1['a'] = 'aaa'
db1['b'] = 'bbb'
db1['c'] = 'ccc'
p db1.to_hash #=> {"a"=>"aaa", "b"=>"bbb", "c"=>"ccc"}... -
ENV
. to _ hash -> Hash (18201.0) -
環境変数の名前をキーとし、対応する値をもつハッシュを返します。
環境変数の名前をキーとし、対応する値をもつハッシュを返します。 -
GDBM
# to _ hash -> Hash (18201.0) -
self の各要素を格納したハッシュを返します。
self の各要素を格納したハッシュを返します。 -
YAML
:: DBM # to _ hash -> Hash (18201.0) -
自身のキー、値をハッシュにしたものを返します。
自身のキー、値をハッシュにしたものを返します。 -
JSON
:: State # to _ hash -> Hash (15201.0) -
自身をハッシュに変換します。
自身をハッシュに変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# ...