Class: Hyrax::ValkyrieGlobalIdProxy
- Inherits:
-
Object
- Object
- Hyrax::ValkyrieGlobalIdProxy
- Defined in:
- app/models/hyrax/valkyrie_global_id_proxy.rb
Overview
Support GlobalID and ActiveJob Serialization/Deserialization for ‘Valkyrie::Resource` models.
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ String
-
#initialize(resource:) ⇒ ValkyrieGlobalIdProxy
constructor
A new instance of ValkyrieGlobalIdProxy.
Constructor Details
#initialize(resource:) ⇒ ValkyrieGlobalIdProxy
Returns a new instance of ValkyrieGlobalIdProxy.
28 29 30 |
# File 'app/models/hyrax/valkyrie_global_id_proxy.rb', line 28 def initialize(resource:) self.resource = resource end |
Instance Attribute Details
#resource ⇒ Hyrax::Resource
24 25 26 |
# File 'app/models/hyrax/valkyrie_global_id_proxy.rb', line 24 def resource @resource end |
Class Method Details
.find(id) ⇒ Valkyrie::Resource
34 35 36 |
# File 'app/models/hyrax/valkyrie_global_id_proxy.rb', line 34 def self.find(id) Hyrax.query_service.find_by(id: id) end |
Instance Method Details
#id ⇒ String
40 41 42 |
# File 'app/models/hyrax/valkyrie_global_id_proxy.rb', line 40 def id resource.id.to_s end |