Class: Wings::ActiveFedoraAttributes
- Inherits:
-
Object
- Object
- Wings::ActiveFedoraAttributes
- Defined in:
- lib/wings/converter_value_mapper.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ActiveFedoraAttributes
constructor
A new instance of ActiveFedoraAttributes.
- #result ⇒ Object
Constructor Details
#initialize(attributes) ⇒ ActiveFedoraAttributes
Returns a new instance of ActiveFedoraAttributes.
248 249 250 251 |
# File 'lib/wings/converter_value_mapper.rb', line 248 def initialize(attributes) attributes = attributes.merge(file_name: attributes[:original_filename]) if attributes[:original_filename] @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (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
253 254 255 |
# File 'lib/wings/converter_value_mapper.rb', line 253 def self.mapped_attributes(attributes:) new(attributes).result end |
Instance Method Details
#result ⇒ Object
257 258 259 260 261 262 263 |
# File 'lib/wings/converter_value_mapper.rb', line 257 def result Hash[ attributes.map do |value| ConverterValueMapper.for(value).result end.select(&:present?) ] end |