Module: GeoConcerns::MetadataExtractionHelper
- Included in:
- ImageWorkBehavior, RasterWorkBehavior, VectorWorkBehavior
- Defined in:
- app/models/concerns/geo_concerns/metadata_extraction_helper.rb
Instance Attribute Summary collapse
-
#should_populate_metadata ⇒ Object
Returns the value of attribute should_populate_metadata.
Instance Method Summary collapse
-
#extract_metadata(id) ⇒ Hash
Extracts properties from the constitutent external metadata file.
-
#populate_metadata(id) ⇒ Object
Sets properties from the constitutent external metadata file.
Instance Attribute Details
#should_populate_metadata ⇒ Object
Returns the value of attribute should_populate_metadata.
18 19 20 |
# File 'app/models/concerns/geo_concerns/metadata_extraction_helper.rb', line 18 def @should_populate_metadata end |
Instance Method Details
#extract_metadata(id) ⇒ Hash
Extracts properties from the constitutent external metadata file
5 6 7 8 9 |
# File 'app/models/concerns/geo_concerns/metadata_extraction_helper.rb', line 5 def (id) return {} if .blank? = .find { |f| f.id == id } . if end |
#populate_metadata(id) ⇒ Object
Sets properties from the constitutent external metadata file
12 13 14 15 16 |
# File 'app/models/concerns/geo_concerns/metadata_extraction_helper.rb', line 12 def (id) (id).each do |k, v| send("#{k}=".to_sym, v) # set each property end end |