851件ヒット
[1-100件を表示]
(0.027秒)
ライブラリ
- ビルトイン (359)
- csv (12)
-
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) -
minitest
/ unit (1) - open3 (108)
- optparse (36)
- rake (60)
-
rexml
/ document (12) -
rubygems
/ command (12) - win32ole (12)
クラス
- BigDecimal (12)
-
CSV
:: Row (12) - Complex (12)
- Date (12)
- DateTime (12)
- Exception (12)
-
Gem
:: Command (12) - Hash (24)
- IO (168)
-
MiniTest
:: Unit (1) - OpenStruct (12)
- OptionParser (24)
-
REXML
:: Element (12) -
Rake
:: TaskArguments (60) - Range (12)
- Rational (12)
- Regexp (12)
-
RubyVM
:: InstructionSequence (12) - String (12)
- Struct (16)
- Symbol (12)
- Time (12)
- WIN32OLE (12)
モジュール
- Enumerable (19)
- Kernel (108)
- Open3 (108)
-
OptionParser
:: Arguable (12)
キーワード
- % (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (12)
-
NEWS for Ruby 2
. 2 . 0 (11) - Numeric (12)
- [] (13)
- each (12)
- exec (24)
- format (12)
- getopts (36)
- inspect (12)
- invoke (12)
- new (15)
- pipeline (12)
-
pipeline
_ r (24) -
pipeline
_ rw (24) -
pipeline
_ start (24) -
pipeline
_ w (24) - popen (168)
-
process
_ args (1) -
rb
_ f _ hash (12) -
ruby 1
. 6 feature (12) - shift (12)
- spawn (24)
-
specific
_ extra _ args _ hash (12) - sprintf (12)
-
st
_ foreach (12) - system (24)
-
to
_ a (12) -
to
_ h (19) -
to
_ hash (12) -
to
_ json (144) -
to
_ s (12) - tsort (12)
-
with
_ defaults (12) - メソッド呼び出し(super・ブロック付き・yield) (12)
- リテラル (12)
検索結果
先頭5件
-
Hash
# [](key) -> object | nil (21072.0) -
key に関連づけられた値を返します。
...る必要が
ある場合は Hash#fetch または Hash#key? を使ってください。
@param key 探索するキーを指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil
h1 = Hash.new("default value")
p h1[:non]......#=> "default value"
h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}
@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc... -
Hash
# shift -> [object , object] | nil (21036.0) -
ハッシュからキーが追加された順で先頭の要素をひとつ取り除き、 [key, value]という配列として返します。
...取り除かれた残りのハッシュに変更されます。
Ruby 3.2以前は、ハッシュが空の場合、デフォルト値(Hash#defaultまたはHash#default_procのブロックの値か、どちらもnilならばnil)
を返します(このとき、[key,value] という形式の値を......#=> [:cd, "all"]
p h #=> {}
p h.shift #=> nil
h1 = Hash.new("default value")
p h1 #=> {}
p h1.shift #=> "default value"
h2 = Hash.new {|*arg| arg}
p h2 #=> {}
p h2.shift #=> [{}, nil]
//}
@see Arra......#=> [:cd, "all"]
p h #=> {}
p h.shift #=> nil
h1 = Hash.new("default value")
p h1 #=> {}
p h1.shift #=> nil
h2 = Hash.new {|*arg| arg}
p h2 #=> {}
p h2.shift #=> nil
//}
@see Array#shift... -
Kernel
. # Hash(arg) -> Hash (18397.0) -
引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で Hash オブジェクトに変換します。nil か [] を指定した場合は空の Hash オブジェクトを返します。
...引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で
Hash オブジェクトに変換します。nil か [] を指定した場合は空の
Hash オブジェクトを返します。
@param arg 変換対象のオブジェクトを指定します。
//emlist[例]......[ruby]{
Hash([]) # => {}
Hash(nil) # => {}
Hash(key: :value) # => {:key => :value}
Hash([1, 2, 3]) # => TypeError
//}
@raise TypeError 変換できないオブジェクトを指定した場合に発生します。... -
Gem
:: Command . specific _ extra _ args _ hash -> Hash (12302.0) -
特別な追加引数へのアクセスを提供します。
特別な追加引数へのアクセスを提供します。 -
Rake
:: TaskArguments # to _ hash -> Hash (9208.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
//}... -
MiniTest
:: Unit # process _ args(args = []) -> Hash (6301.0) -
optparse を使ってコマンドライン引数を解析した結果を返します。
...optparse を使ってコマンドライン引数を解析した結果を返します。
@param args コマンドライン引数を指定します。
@see optparse... -
static VALUE rb
_ f _ hash(VALUE obj , VALUE arg) (6216.0) -
Kernel.#Hash の実体です。
...Kernel.#Hash の実体です。... -
OptionParser
:: Arguable # getopts(short _ opt , *long _ opt) -> Hash (3117.0) -
指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。
...指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。
コマンドラインに - もしくは -- を指定した場合、それ以降の解析を行ないません。
@param short_opt ショートネームのオプション(-f や -fx)......Parser::ParseError のサブク
ラスの例外になります。
//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.getopts("ab:", "foo", "bar:", "bufsize:1024")
p params
//}
# 実行結果
$ ruby t.rb -b 1 --foo --bar xxx -- -a
{"bufsize"=>"1024", "a"=>fal... -
Rake
:: TaskArguments # with _ defaults(defaults) -> Hash (3113.0) -
パラメータにデフォルト値をセットします。
...る
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"}
arguments.with_defaults({ default_key: "default_value"}) # =......> {:default_key=>"default_value", :name1=>"value1", :name2=>"value2"}
arguments.to_hash # => {:default_key=>"default_value", :name1=>"value1", :name2=>"value2"}
end
//}... -
Rake
:: TaskArguments # each {|key , val| . . . } -> Hash (3107.0) -
自身に含まれるパラメータ名とそれに対応する値をブロックパラメータとしてブロックを評価します。
...自身に含まれるパラメータ名とそれに対応する値をブロックパラメータとしてブロックを評価します。
@see Hash#each...