Class: Dynamoid::TransactionWrite::Create
- Defined in:
- lib/dynamoid/transaction_write/create.rb
Instance Method Summary collapse
- #aborted? ⇒ Boolean
- #action_request ⇒ Object
-
#initialize(model_class, attributes = {}, **options, &block) ⇒ Create
constructor
A new instance of Create.
- #observable_by_user_result ⇒ Object
- #on_commit ⇒ Object
- #on_registration ⇒ Object
- #on_rollback ⇒ Object
- #skipped? ⇒ Boolean
Constructor Details
#initialize(model_class, attributes = {}, **options, &block) ⇒ Create
Returns a new instance of Create.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dynamoid/transaction_write/create.rb', line 8 def initialize(model_class, attributes = {}, **, &block) super() @model = model_class.new(attributes) if block yield(@model) end @save_action = Save.new(@model, **) end |
Instance Method Details
#aborted? ⇒ Boolean
32 33 34 |
# File 'lib/dynamoid/transaction_write/create.rb', line 32 def aborted? @save_action.aborted? end |
#action_request ⇒ Object
44 45 46 |
# File 'lib/dynamoid/transaction_write/create.rb', line 44 def action_request @save_action.action_request end |
#observable_by_user_result ⇒ Object
40 41 42 |
# File 'lib/dynamoid/transaction_write/create.rb', line 40 def observable_by_user_result @model end |
#on_commit ⇒ Object
24 25 26 |
# File 'lib/dynamoid/transaction_write/create.rb', line 24 def on_commit @save_action.on_commit end |
#on_registration ⇒ Object
20 21 22 |
# File 'lib/dynamoid/transaction_write/create.rb', line 20 def on_registration @save_action.on_registration end |
#on_rollback ⇒ Object
28 29 30 |
# File 'lib/dynamoid/transaction_write/create.rb', line 28 def on_rollback @save_action.on_rollback end |
#skipped? ⇒ Boolean
36 37 38 |
# File 'lib/dynamoid/transaction_write/create.rb', line 36 def skipped? false end |