Class: Hydra::Works::AddExternalFileToFileSet::Updater
- Inherits:
-
Object
- Object
- Hydra::Works::AddExternalFileToFileSet::Updater
- Defined in:
- lib/hydra/works/services/add_external_file_to_file_set.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#current_file ⇒ Object
readonly
Returns the value of attribute current_file.
-
#file_set ⇒ Object
readonly
Returns the value of attribute file_set.
Instance Method Summary collapse
-
#initialize(file_set, type, update_existing) ⇒ Updater
constructor
A new instance of Updater.
-
#update(external_file_url, filename = nil) ⇒ Object
None of the attribute description methods are required.
Constructor Details
#initialize(file_set, type, update_existing) ⇒ Updater
Returns a new instance of Updater.
30 31 32 33 |
# File 'lib/hydra/works/services/add_external_file_to_file_set.rb', line 30 def initialize(file_set, type, update_existing) @file_set = file_set @current_file = find_or_create_file(type, update_existing) end |
Instance Attribute Details
#current_file ⇒ Object (readonly)
Returns the value of attribute current_file.
28 29 30 |
# File 'lib/hydra/works/services/add_external_file_to_file_set.rb', line 28 def current_file @current_file end |
#file_set ⇒ Object (readonly)
Returns the value of attribute file_set.
28 29 30 |
# File 'lib/hydra/works/services/add_external_file_to_file_set.rb', line 28 def file_set @file_set end |
Instance Method Details
#update(external_file_url, filename = nil) ⇒ Object
None of the attribute description methods are required.
37 38 39 40 |
# File 'lib/hydra/works/services/add_external_file_to_file_set.rb', line 37 def update(external_file_url, filename = nil) attach_attributes(external_file_url, filename) persist end |