Class: Wings::ActiveFedoraAttributes

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ ActiveFedoraAttributes

Returns a new instance of ActiveFedoraAttributes.



248
249
250
# File 'lib/wings/converter_value_mapper.rb', line 248

def initialize(attributes)
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



246
247
248
# File 'lib/wings/converter_value_mapper.rb', line 246

def attributes
  @attributes
end

Class Method Details

.mapped_attributes(attributes:) ⇒ Object



252
253
254
# File 'lib/wings/converter_value_mapper.rb', line 252

def self.mapped_attributes(attributes:)
  new(attributes).result
end

Instance Method Details

#resultObject



256
257
258
259
260
261
262
# File 'lib/wings/converter_value_mapper.rb', line 256

def result
  Hash[
    attributes.map do |value|
      ConverterValueMapper.for(value).result
    end.select(&:present?)
  ]
end