Class: Hydra::Works::AddFileToFileSet::Updater
- Inherits:
-
Object
- Object
- Hydra::Works::AddFileToFileSet::Updater
- Defined in:
- lib/hydra/works/services/add_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(file) ⇒ Object
None of the attribute description methods are required.
Constructor Details
#initialize(file_set, type, update_existing) ⇒ Updater
Returns a new instance of Updater.
26 27 28 29 |
# File 'lib/hydra/works/services/add_file_to_file_set.rb', line 26 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.
24 25 26 |
# File 'lib/hydra/works/services/add_file_to_file_set.rb', line 24 def current_file @current_file end |
#file_set ⇒ Object (readonly)
Returns the value of attribute file_set.
24 25 26 |
# File 'lib/hydra/works/services/add_file_to_file_set.rb', line 24 def file_set @file_set end |
Instance Method Details
#update(file) ⇒ Object
None of the attribute description methods are required.
33 34 35 36 |
# File 'lib/hydra/works/services/add_file_to_file_set.rb', line 33 def update(file) attach_attributes(file) persist end |