1357件ヒット
[1-100件を表示]
(0.144秒)
ライブラリ
- ビルトイン (615)
-
cgi
/ session (33) -
cgi
/ session / pstore (11) - csv (44)
- dbm (22)
- erb (7)
- gdbm (22)
- json (143)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) - matrix (11)
- openssl (44)
- optparse (33)
- ostruct (12)
- pstore (55)
- rake (44)
-
rdoc
/ top _ level (11) -
rexml
/ document (22) -
rubygems
/ source _ index (11) - sdbm (44)
- tsort (30)
-
yaml
/ dbm (11)
クラス
- Array (57)
- BigDecimal (11)
-
CGI
:: Session :: FileStore (11) -
CGI
:: Session :: MemoryStore (11) -
CGI
:: Session :: NullStore (11) -
CGI
:: Session :: PStore (11) -
CSV
:: Row (22) -
CSV
:: Table (22) - Complex (11)
- DBM (22)
- Data (6)
- Date (11)
- DateTime (11)
- ERB (7)
-
Enumerator
:: ArithmeticSequence (6) - Exception (11)
- GDBM (22)
-
Gem
:: SourceIndex (11) - Hash (401)
-
JSON
:: State (22) - Module (5)
- Object (11)
-
OpenSSL
:: X509 :: Extension (11) -
OpenSSL
:: X509 :: ExtensionFactory (33) - OpenStruct (23)
- OptionParser (22)
- PStore (55)
- Proc (5)
-
RDoc
:: TopLevel (11) -
REXML
:: DocType (11) -
REXML
:: Element (11) -
Rake
:: TaskArguments (44) - Range (11)
- Rational (11)
- Regexp (11)
-
RubyVM
:: InstructionSequence (11) - SDBM (44)
- String (33)
- Struct (28)
- Symbol (11)
- Time (11)
- UnboundMethod (11)
- Vector (11)
-
YAML
:: DBM (11)
モジュール
- Enumerable (52)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) -
OptionParser
:: Arguable (11) - TSort (30)
キーワード
- % (11)
- << (11)
- [] (11)
-
add
_ class _ or _ module (11) -
add
_ element (11) - collect (24)
-
create
_ ext _ from _ hash (11) -
create
_ extension (22) -
deconstruct
_ keys (2) - delete (11)
-
delete
_ if (22) - each (22)
-
each
_ key (11) -
each
_ pair (11) -
each
_ strongly _ connected _ component (10) -
each
_ strongly _ connected _ component _ from (10) -
each
_ value (11) - entities (11)
- fetch (11)
- filter (6)
- filter! (6)
- getopts (33)
-
group
_ by (11) - gsub (11)
- gsub! (11)
- inspect (22)
- intersection (5)
-
keep
_ if (11) - keys (11)
- map (24)
- merge (22)
- merge! (22)
- owner (11)
- reject (55)
- reject! (22)
- replace (22)
- restore (44)
- result (7)
- root? (11)
- roots (11)
-
ruby2
_ keywords (10) - select (11)
- select! (11)
- store (11)
-
to
_ a (22) -
to
_ csv (11) -
to
_ h (106) -
to
_ hash (99) -
to
_ json (231) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
to
_ proc (9) -
to
_ s (33) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
tsort
_ each (10) - update (33)
- values (11)
-
with
_ defaults (11) - | (11)
検索結果
先頭5件
-
Hash
# to _ hash -> self (21375.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}
@see Object#to_hash, Hash#to_h... -
Enumerator
:: ArithmeticSequence # hash -> Integer (21202.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
begin, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。 -
Vector
# hash -> Integer (21202.0) -
自分自身のハッシュ値を返します。
自分自身のハッシュ値を返します。 -
Hash
# to _ h -> self | Hash (15445.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......# => MyHash
p my_hash.to_h.class # => Hash
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } # =>... -
Hash
# to _ h {|key , value| block } -> Hash (15445.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......# => MyHash
p my_hash.to_h.class # => Hash
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } # =>... -
Hash
# to _ h -> self | Hash (15419.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......s # => MyHash
p my_hash.to_h.class # => Hash
//}... -
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (15321.0) -
自身から生成した JSON 形式の文字列を返します。
...の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emli......st[例][ruby]{
require "json"
person = { "name" => "tanaka", "age" => 19 }
person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
//}... -
Hash
# to _ a -> [Array] (15220.0) -
キーと値からなる 2 要素の配列を並べた配列を生成して返します。
...キーと値からなる 2 要素の配列を並べた配列を生成して返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.to_a #=> c, "c"
//}
@see Hash#keys,Hash#values... -
Hash
# to _ proc -> Proc (15202.0) -
self のキーに対応する値を返す Proc オブジェクトを返します。
self のキーに対応する値を返す Proc オブジェクトを返します。
//emlist[][ruby]{
h = {1 => 10, 2 => 20, 3 => 30}
[1, 2, 3].map(&h) # => [10, 20, 30]
//} -
Object
# to _ hash -> Hash (12432.0) -
オブジェクトの Hash への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...オブジェクトの Hash への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要......すべての場面で代置可能であるような、
* ハッシュそのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_hash
{'as' => 24}
end
end
it = Foo.new
p({:as => 12}.merge(it)) #=> {"as"=>24, :as=>12}
//}... -
CSV
:: Row # to _ hash -> Hash (12416.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 (12416.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"}...