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::WithAccessRight

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

Instance Attribute Details

#fileObject

Returns the value of attribute file.



15
16
17
# File 'app/repository_models/generic_file.rb', line 15

def file
  @file
end

#versionObject

Returns the value of attribute version.



15
16
17
# File 'app/repository_models/generic_file.rb', line 15

def version
  @version
end

Instance Method Details

#current_version_idObject



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

def current_version_id
  content.latest_version.versionID
end

#filenameObject



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

def filename
  content.label
end

#human_readable_typeObject



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

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

#to_sObject



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

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

#versionsObject



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

def versions
  content.versions
end