Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2014-05-13から1日間の記事一覧

TbpgrUtils | 追加要件 Array#uniq_size 追加

概要 追加要件 Array#uniq_size 追加 詳細 追加要件 Array#uniq_size 仕様 ・Array#uniq.sizeと同等の処理です。 ※より詳細についてはGitHubのREADMEおよびテストケース参照 GitHub https://github.com/tbpgr/tbpgr_utils Rubygems http://rubygems.org/gems…

Ruby | Collecting Inputs | Receive policies instead of data

概要 Receive policies instead of data 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling Failure(例…

Ruby | Collecting Inputs | Yield a parameter builder object

概要 Yield a parameter builder object 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling Failure(例…

Ruby | Collecting Inputs | Bundle arguments into parameter object

概要 Bundle arguments into parameter object 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling Fail…

Ruby | Collecting Inputs | Use symbols as placeholder object

概要 Use symbols as placeholder object 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling Failure(…

Ruby | Collecting Inputs | Substitute a benign value for nil

概要 Substitute a benign value for nil 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling Failure(…

Ruby | Collecting Inputs | Represent do-nothing cases as null objects

概要 Represent do-nothing cases as null objects 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handling …

Ruby | Kernel | format

概要 Kernel#format(format, *arg) -> String 詳細 C言語の sprintf の類似機能。 詳細については後述のリンク先の公式ドキュメント参照 サンプルコード puts format "%c", 97 puts format "%c, %s, %i", 'a', 'hoge', '0b1000' 出力 a a, hoge, 8 参照 http…