Class: Wings::NestedResourceValue

Inherits:
Valkyrie::ValueMapper
  • Object
show all
Defined in:
lib/wings/converter_value_mapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.handles?(value) ⇒ Boolean

Returns:

  • (Boolean)


234
235
236
# File 'lib/wings/converter_value_mapper.rb', line 234

def self.handles?(value)
  value.last.is_a?(Dry::Struct)
end

Instance Method Details

#resultObject



238
239
240
241
242
# File 'lib/wings/converter_value_mapper.rb', line 238

def result
  attrs = ActiveFedoraConverter.new(resource: value.last).attributes

  [value.first, ActiveFedoraAttributes.new(attrs).result]
end