serradura / u-case

Represent use cases in a simple and powerful way while writing modular, expressive and sequentially logical code.
https://rubygems.org/gems/u-case
MIT License
527 stars 33 forks source link

Improve the inspect output #91

Closed serradura closed 4 years ago

serradura commented 4 years ago

Suggestions:

Micro::Case instance

<Sum (Micro::Case) attributes={a: 1, b: 1}>
<Sum (Micro::Case::Safe) attributes={a: 1, b: 1}>
<Sum (Micro::Case::Strict) attributes={a: 1, b: 1}>

Micro::Case:::Result instance

<Success (Micro::Case::Result) type=:ok data={number: 2} transitions=1>

<Failure (Micro::Case::Result) type=:invalid_number data={invalid_number: true} transitions=1>

Micro::Cases::Flow instance

<Add9 (Micro::Cases::Flow) use_cases=[Add3, Add3, Add3]>
<Add9 (Micro::Cases::Safe::Flow) use_cases=[Add3, Add3, Add3]>