Module: Bolognese::Readers::DataciteJsonReader
- Included in:
- MetadataUtils
- Defined in:
- lib/bolognese/readers/datacite_json_reader.rb
Instance Method Summary collapse
Instance Method Details
#read_datacite_json(string: nil, **options) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/bolognese/readers/datacite_json_reader.rb', line 6 def read_datacite_json(string: nil, **) errors = jsonlint(string) return { "errors" => errors } if errors.present? datacite_json = string.present? ? Maremma.from_json(string).transform_keys! { |key| key.underscore } : {} datacite_json["publisher"] = normalize_publisher(datacite_json["publisher"]) if datacite_json.fetch("publisher", nil).present? datacite_json end |