Module: Sufia::GenericFile::ReloadOnSave

Included in:
Sufia::GenericFile
Defined in:
app/models/concerns/sufia/generic_file/reload_on_save.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reload_on_save=(value) ⇒ Object (writeonly)

Sets the attribute reload_on_save

Parameters:

  • value

    the value to set the attribute reload_on_save to.



6
7
8
# File 'app/models/concerns/sufia/generic_file/reload_on_save.rb', line 6

def reload_on_save=(value)
  @reload_on_save = value
end

Instance Method Details

#refreshObject



12
13
14
# File 'app/models/concerns/sufia/generic_file/reload_on_save.rb', line 12

def refresh
  self.reload if reload_on_save?
end

#reload_on_save?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/concerns/sufia/generic_file/reload_on_save.rb', line 8

def reload_on_save?
  !!@reload_on_save
end