Class: GenericFile

Inherits:
ActiveFedora::Base
  • Object
show all
Includes:
Curate::ActiveModelAdaptor, CurationConcern::Embargoable, Hydra::AccessControls::Permissions, Sufia::GenericFile::Audit, Sufia::GenericFile::Characterization, Sufia::GenericFile::Derivatives, Sufia::GenericFile::MimeTypes, Sufia::GenericFile::Thumbnail, Sufia::GenericFile::Versions, Sufia::ModelMethods
Defined in:
app/repository_models/generic_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Curate::ActiveModelAdaptor

#noid, #to_key, #to_param

Methods included from CurationConcern::Embargoable

#embargo_release_date, #embargo_release_date=

Instance Attribute Details

#fileObject

Returns the value of attribute file.



33
34
35
# File 'app/repository_models/generic_file.rb', line 33

def file
  @file
end

#versionObject

Returns the value of attribute version.



33
34
35
# File 'app/repository_models/generic_file.rb', line 33

def version
  @version
end

Instance Method Details

#current_version_idObject



48
49
50
# File 'app/repository_models/generic_file.rb', line 48

def current_version_id
  content.latest_version.versionID
end

#filenameObject



35
36
37
# File 'app/repository_models/generic_file.rb', line 35

def filename
  content.label
end

#human_readable_typeObject



52
53
54
# File 'app/repository_models/generic_file.rb', line 52

def human_readable_type
  self.class.to_s.demodulize.titleize
end

#to_sObject



39
40
41
42
# File 'app/repository_models/generic_file.rb', line 39

def to_s
  return title.join(", ") if title.present?
  label || "No Title"
end

#versionsObject



44
45
46
# File 'app/repository_models/generic_file.rb', line 44

def versions
  content.versions
end