1527件ヒット
[1-100件を表示]
(0.126秒)
ライブラリ
- ビルトイン (704)
-
cgi
/ session (36) -
cgi
/ session / pstore (12) - csv (48)
- dbm (24)
- erb (8)
- gdbm (24)
- json (156)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / ostruct (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / symbol (12) -
json
/ add / time (12) - matrix (12)
- openssl (48)
- optparse (36)
- ostruct (14)
- pstore (72)
- rake (48)
-
rdoc
/ top _ level (12) -
rexml
/ document (24) -
rubygems
/ source _ index (12) - sdbm (48)
- tsort (33)
-
yaml
/ dbm (12)
クラス
- Array (65)
- BigDecimal (12)
-
CGI
:: Session :: FileStore (12) -
CGI
:: Session :: MemoryStore (12) -
CGI
:: Session :: NullStore (12) -
CGI
:: Session :: PStore (12) -
CSV
:: Row (24) -
CSV
:: Table (24) - Complex (12)
- DBM (24)
- Data (9)
- Date (12)
- DateTime (12)
- ERB (8)
-
Enumerator
:: ArithmeticSequence (7) - Exception (12)
- GDBM (24)
-
Gem
:: SourceIndex (12) - Hash (455)
-
JSON
:: State (24) - Module (12)
- Object (12)
-
OpenSSL
:: X509 :: Extension (12) -
OpenSSL
:: X509 :: ExtensionFactory (36) - OpenStruct (26)
- OptionParser (24)
- PStore (72)
- Proc (6)
-
RDoc
:: TopLevel (12) -
REXML
:: DocType (12) -
REXML
:: Element (12) -
Rake
:: TaskArguments (48) - Range (12)
- Rational (12)
- Regexp (12)
-
RubyVM
:: InstructionSequence (12) - SDBM (48)
- String (36)
- Struct (31)
- Symbol (12)
- Time (12)
- UnboundMethod (12)
- Vector (12)
-
YAML
:: DBM (12)
モジュール
- Enumerable (59)
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (36) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) -
OptionParser
:: Arguable (12) - TSort (33)
キーワード
- % (12)
- << (12)
- [] (12)
- []= (12)
-
add
_ class _ or _ module (12) -
add
_ element (12) - collect (28)
-
create
_ ext _ from _ hash (12) -
create
_ extension (24) -
deconstruct
_ keys (3) -
default
_ proc= (12) - delete (12)
-
delete
_ if (24) - each (24)
-
each
_ key (12) -
each
_ pair (12) -
each
_ strongly _ connected _ component (11) -
each
_ strongly _ connected _ component _ from (11) -
each
_ value (12) - entities (12)
- fetch (12)
- filter (7)
- filter! (7)
- getopts (36)
-
group
_ by (12) - gsub (12)
- gsub! (12)
- inspect (24)
- intersection (6)
-
keep
_ if (12) - keys (12)
- map (28)
- merge (24)
- merge! (24)
- owner (12)
- reject (60)
- reject! (24)
- replace (24)
- restore (48)
- result (8)
- root? (12)
- roots (12)
-
ruby2
_ keywords (18) - select (12)
- select! (12)
- store (12)
-
to
_ a (24) -
to
_ csv (12) -
to
_ h (120) -
to
_ hash (108) -
to
_ json (252) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ proc (10) -
to
_ s (36) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) -
tsort
_ each (11) - update (36)
- values (12)
-
with
_ defaults (12) - | (12)
検索結果
先頭5件
-
Hash
# to _ hash -> self (21275.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 (21102.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
begin, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。 -
Vector
# hash -> Integer (21102.0) -
自分自身のハッシュ値を返します。
自分自身のハッシュ値を返します。 -
Hash
# to _ h -> self | Hash (15339.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
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } #... -
Hash
# to _ h {|key , value| block } -> Hash (15339.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
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } #... -
Hash
# to _ h -> self | Hash (15319.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 (15221.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] (15120.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 (15102.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 (12332.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 (12316.0) -
自身をシンプルなハッシュに変換します。
...プルなハッシュに変換します。
フィールドの順序は無視されます。
重複したフィールドは削除されます。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header2", "header1", "header2"], [1, 2, 3])
row.to_hash # => {"header2"=>3, "header1"=>2}
//}...