Class: Wings::ActiveFedoraConverter::DefaultWork

Inherits:
ActiveFedora::Base show all
Includes:
Hydra::AccessControls::Embargoable, Hyrax::Noid, Hyrax::Permissions
Defined in:
lib/wings/active_fedora_converter/default_work.rb

Overview

A base model class for valkyrie resources that don't have corresponding ActiveFedora::Base models.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Hyrax::Permissions::Readable

#private?, #public?, #registered?

Methods included from Hyrax::Permissions::Writable

#paranoid_permissions

Methods included from Hyrax::Noid

#assign_id

Methods inherited from ActiveFedora::Base

supports_property?

Class Method Details

._to_partial_pathObject


112
113
114
# File 'lib/wings/active_fedora_converter/default_work.rb', line 112

def _to_partial_path
  "hyrax/#{valkyrie_class.model_name.collection}/#{valkyrie_class.model_name.element}"
end

.model_nameObject


116
117
118
# File 'lib/wings/active_fedora_converter/default_work.rb', line 116

def model_name(*)
  Hyrax::Name.new(valkyrie_class)
end

.to_rdf_representationObject Also known as: inspect


120
121
122
# File 'lib/wings/active_fedora_converter/default_work.rb', line 120

def to_rdf_representation
  "Wings(#{valkyrie_class})"
end

Instance Method Details

#enforce_future_date_for_embargo?Boolean

Override aggressive Hydra::AccessControls validation

Returns:

  • (Boolean)

129
130
131
# File 'lib/wings/active_fedora_converter/default_work.rb', line 129

def enforce_future_date_for_embargo?
  false
end

#enforce_future_date_for_lease?Boolean

Override aggressive Hydra::AccessControls validation

Returns:

  • (Boolean)

135
136
137
# File 'lib/wings/active_fedora_converter/default_work.rb', line 135

def enforce_future_date_for_lease?
  false
end

#indexing_serviceObject


139
140
141
# File 'lib/wings/active_fedora_converter/default_work.rb', line 139

def indexing_service
  Hyrax::ValkyrieIndexer.for(resource: valkyrie_resource)
end

#to_global_idObject


143
144
145
# File 'lib/wings/active_fedora_converter/default_work.rb', line 143

def to_global_id
  GlobalID.create(valkyrie_class.new(id: id))
end