Class: Stash::Merritt::SubmissionPackage::MerrittDeleteBuilder
- Inherits:
-
Repo::FileBuilder
- Object
- Repo::FileBuilder
- Stash::Merritt::SubmissionPackage::MerrittDeleteBuilder
- Defined in:
- lib/stash/merritt/submission_package/merritt_delete_builder.rb
Instance Attribute Summary collapse
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
Instance Method Summary collapse
- #contents ⇒ Object
-
#initialize(resource_id:) ⇒ MerrittDeleteBuilder
constructor
A new instance of MerrittDeleteBuilder.
- #resource ⇒ Object
Constructor Details
#initialize(resource_id:) ⇒ MerrittDeleteBuilder
Returns a new instance of MerrittDeleteBuilder.
9 10 11 12 |
# File 'lib/stash/merritt/submission_package/merritt_delete_builder.rb', line 9 def initialize(resource_id:) super(file_name: 'mrt-delete.txt') @resource_id = resource_id end |
Instance Attribute Details
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
7 8 9 |
# File 'lib/stash/merritt/submission_package/merritt_delete_builder.rb', line 7 def resource_id @resource_id end |
Instance Method Details
#contents ⇒ Object
18 19 20 21 |
# File 'lib/stash/merritt/submission_package/merritt_delete_builder.rb', line 18 def contents del_files = resource.file_uploads.deleted del_files.blank? ? nil : del_files.map(&:upload_file_name).join("\n") end |
#resource ⇒ Object
14 15 16 |
# File 'lib/stash/merritt/submission_package/merritt_delete_builder.rb', line 14 def resource @resource ||= StashEngine::Resource.find(resource_id) end |