fnordfish / teckel

Ruby operations with enforced contracts for input/output/error data structures

Home Page:https://fnordfish.github.io/teckel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add default settings

fnordfish opened this issue · comments

Currently, when an Operation is called without settings (MyOp.call()), settings inside the operation are nil.

Add a way on Operation class level, to declare the use of default settings.

settings Struct.new(:foo, :bar)
default_settings { settings.new("value") }

Maybe add a shortcut to call the settings_constructor without any values:

default_settings! # equivalent to `default_settings { settings_constructor.call }`

Same thing for Chains of course.