110件ヒット
[101-110件を表示]
(0.074秒)
別のキーワード
ライブラリ
- ビルトイン (61)
- abbrev (12)
- csv (3)
- date (4)
- rake (12)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
モジュール
- FileUtils (12)
検索結果
先頭3件
-
MatchData
# deconstruct _ keys(array _ of _ names) -> Hash (107.0) -
引数で指定された名前の名前付きキャプチャを Hash で返します。
...引数で指定された名前の名前付きキャプチャを Hash で返します。
Hash のキーは名前付きキャプチャの名前のシンボル、値はキーの名前に対応した名前付きグループのうち最後にマッチした文字列です。
@param array_of_names 名......{:hours => "18", :minutes => "37", :seconds => "22"}
# 名前付きキャプチャが定義されていなかった場合は空のハッシュを返す
m = /(\d{2}):(\d{2}):(\d{2})/.match("18:37:22")
m.deconstruct_keys(nil) # => {}
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (107.0) -
self のメンバの名前と値の組を Hash で返します。
...self のメンバの名前と値の組を Hash で返します。
@param array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new......345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Time
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (107.0) -
パターンマッチに使用する名前と値の Hash を返します。
...パターンマッチに使用する名前と値の Hash を返します。
キーに利用できる名前は以下の通りです。
* :year
* :month
* :day
* :yday
* :wday
* :hour
* :min
* :sec
* :subsec
* :dst
* :zone
@param array_of_names_or_nil パターンマッチに......ng day in month #{month}"
end
#=> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if t in Time(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects...