Tbpgr Blog

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

Confident Ruby

Ruby | Handling Failure | Use bouncer method

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

Ruby | Handling Failure | Use checked methods for risky operations

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

Ruby | Handling Failure | Prefer top-level rescue clause

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

Ruby | Delivering Output | Yield Status Object

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

Ruby | Delivering Output | Return Status Object

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

Ruby | Delivering Output | Represent failure with a special case object

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

Ruby | Delivering Output | Represent failure with a benign vlaue

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

Ruby | Delivering Result | Call back instead of returning

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

Ruby | Delivering Result | Write total functions

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

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 | Collecting Inputs | Represent special cases as Object

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

Ruby | Collecting Inputs | Handle special cases with Guard Clause

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

Ruby | Collecting Inputs | Document assumptions with assertions

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

Ruby | Collecting Inputs | Use #fetch for defaults

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

Ruby | Collecting Inputs | Use #fetch to assert the presence of Hash keys

概要 Use #fetch to assert the presence of Hash keys 前提 Confident Rubyではメソッド内の処理を次のように分類しています。 ・Collecting Inputs(引数チェック、変換など) ・Performing Work(主処理) ・Delivering Output(戻り値に関わる処理) ・Handl…

Ruby | Collecting Inputs | Reject unworkable values with preconditions

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

Ruby | Collecting Inputs | Use transparent adapters to gradually introduce abstraction

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

Ruby | Collecting Inputs | Wrap collaborators in Adapter

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

Ruby | Collecting Inputs | Replace "string typing" with classes

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

Ruby | Collecting Inputs | Define conversion functions

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

Ruby | Collecting Inputs | Use built-in conversion functions

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

Ruby | Collecting Inputs | Define conversions to user-defined types

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

Ruby | Collecting Inputs | Define your own conversion protocols

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

Ruby | Collecting Inputs | Conditionally call conversion methods

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

Ruby | Collecting Inputs | Use built-in conversion protocols

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