Module: Machinist::Caching::Machinable
- Included in:
- ActiveRecord::Base, Machinable
- Defined in:
- lib/machinist/caching/machinable.rb
Instance Method Summary collapse
-
#make!(*args) ⇒ Object
Construct and save an object from a blueprint, if the class allows saving.
Instance Method Details
#make!(*args) ⇒ Object
Construct and save an object from a blueprint, if the class allows saving.
:call-seq:
make!([count], [blueprint_name], [attributes = {}])
A cached object will be returned from the shop if possible. See Machinist::Caching::Shop.
Arguments are the same as for make.
13 14 15 16 17 |
# File 'lib/machinist/caching/machinable.rb', line 13 def make!(*args) decode_args_to_make(*args) do |blueprint, attributes| Shop.instance.buy(blueprint, attributes) end end |