Class: DoiRecord
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- DoiRecord
- Defined in:
- app/models2/doi_record.rb
Instance Method Summary collapse
Instance Method Details
#normalize ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/models2/doi_record.rb', line 9 def normalize url = URI.parse(body) if url.host =~ /doi\.org\Z/ self.body = url.path.gsub(/\A\//, '').downcase else self.body = body.downcase end rescue URI::InvalidURIError end |
#set_display_body ⇒ Object
19 20 21 |
# File 'app/models2/doi_record.rb', line 19 def set_display_body self.display_body = body unless display_body end |