Class: ActiveShrine::Attached::Changes::CreateMany
- Inherits:
-
Object
- Object
- ActiveShrine::Attached::Changes::CreateMany
- Defined in:
- lib/active_shrine/attached/changes/create_many.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#attachables ⇒ Object
readonly
Returns the value of attribute attachables.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pending_uploads ⇒ Object
readonly
Returns the value of attribute pending_uploads.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #attachments ⇒ Object
-
#initialize(name, record, attachables, pending_uploads: []) ⇒ CreateMany
constructor
A new instance of CreateMany.
- #save ⇒ Object
Constructor Details
#initialize(name, record, attachables, pending_uploads: []) ⇒ CreateMany
Returns a new instance of CreateMany.
9 10 11 12 13 14 15 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 9 def initialize(name, record, attachables, pending_uploads: []) @name = name @record = record @attachables = Array(attachables) @pending_uploads = Array(pending_uploads) + subchanges end |
Instance Attribute Details
#attachables ⇒ Object (readonly)
Returns the value of attribute attachables.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def attachables @attachables end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def name @name end |
#pending_uploads ⇒ Object (readonly)
Returns the value of attribute pending_uploads.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def pending_uploads @pending_uploads end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def record @record end |
Instance Method Details
#attachments ⇒ Object
17 18 19 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 17 def @attachments ||= subchanges.collect(&:attachment) end |
#save ⇒ Object
21 22 23 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 21 def save end |