Class: GenericFile

Inherits:
Object
  • Object
show all
Includes:
CurationConcern::Embargoable, CurationConcern::WithAccessRight
Defined in:
app/repository_models/generic_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CurationConcern::Embargoable

#embargo_release_date, #embargo_release_date=

Methods included from CurationConcern::Embargoable::VisibilityOverride

#set_visibility

Methods included from CurationConcern::WithAccessRight

#authenticated_only_access?, #open_access?, #open_access_with_embargo_release_date?, #private_access?, #under_embargo?

Instance Attribute Details

#fileObject

Returns the value of attribute file.



18
19
20
# File 'app/repository_models/generic_file.rb', line 18

def file
  @file
end

#versionObject

Returns the value of attribute version.



18
19
20
# File 'app/repository_models/generic_file.rb', line 18

def version
  @version
end

Instance Method Details

#current_version_idObject



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

def current_version_id
  content.latest_version.versionID
end

#filenameObject



20
21
22
# File 'app/repository_models/generic_file.rb', line 20

def filename
  content.label
end

#human_readable_typeObject



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

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

#to_sObject



24
25
26
# File 'app/repository_models/generic_file.rb', line 24

def to_s
  title || label || "No Title"
end

#versionsObject



28
29
30
# File 'app/repository_models/generic_file.rb', line 28

def versions
  content.versions
end