Module: Wings::Valkyrizable

Defined in:
lib/wings/valkyrizable.rb

Overview

A mixin for `ActiveFedora::Base` models providing a convenience method mapping to a valkyrie resource.

Examples:

GenericWork.include Wings::Valkyrizable

work     = GenericWork.new(title: ['Comet in Moominland'])
resource = work.valkyrie_resource

resource.title # => ['Comet in Moominland']

See Also:

Instance Method Summary collapse

Instance Method Details

#valkyrie_resourceValkyrie::Resource

Returns a valkyrie resource matching this model.

Returns:

  • (Valkyrie::Resource)

    a valkyrie resource matching this model


20
21
22
# File 'lib/wings/valkyrizable.rb', line 20

def valkyrie_resource
  ModelTransformer.for(self)
end