Module: Dry::Transaction::Extra::ClassCallable
- Defined in:
- lib/dry/transaction/extra/class_callable.rb
Overview
Creates a class-level call method, which creates a new instance and invokes #call on it, delegating all arguments.
These are equivalent:
MyTransaction.new.call(id: 1234)
MyTransaction.call(id: 1234)
Note that if you need to pass arguments to the initializer, you can’t use this, but if you don’t, then this is a nice shortcut.
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/dry/transaction/extra/class_callable.rb', line 18 def call(...) new.call(...) end |