エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Ruby 2.7.0でキーワード引数として渡された引数なのかどうかフラグを確かめる方法 - かみぽわーる
class Hash class << self def ruby2_keywords_hash?(hash) !new(*[hash]).default.equal?(hash) end de... class Hash class << self def ruby2_keywords_hash?(hash) !new(*[hash]).default.equal?(hash) end def ruby2_keywords_hash(hash) _ruby2_keywords_hash(**hash) end private def _ruby2_keywords_hash(*args) args.last end ruby2_keywords(:_ruby2_keywords_hash) if respond_to?(:ruby2_keywords, true) end end RUBY_VERSION # => "2.7.0" def passed_kw?(*args) Hash.ruby2_keywords_hash?(args.last) end ruby2_keywords(
2020/02/26 リンク