Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/dina/utils/identifier.rb
Instance Method Summary collapse
- #is_doi? ⇒ Boolean
- #is_orcid? ⇒ Boolean
- #is_uuid? ⇒ Boolean
- #is_wiki_id? ⇒ Boolean
- #orcid_from_url ⇒ Object
- #wiki_from_url ⇒ Object
Instance Method Details
#is_doi? ⇒ Boolean
12 13 14 |
# File 'lib/dina/utils/identifier.rb', line 12 def is_doi? ::Dina::PersistentIdentifier.is_doi_regex.match?(self) end |
#is_orcid? ⇒ Boolean
3 4 5 6 |
# File 'lib/dina/utils/identifier.rb', line 3 def is_orcid? ::Dina::PersistentIdentifier.is_orcid_regex.match?(self) && ::Dina::Identifier.orcid_valid_checksum(self) end |
#is_uuid? ⇒ Boolean
16 17 18 |
# File 'lib/dina/utils/identifier.rb', line 16 def is_uuid? ::Dina::PersistentIdentifier.is_uuid_regex.match?(self) end |
#is_wiki_id? ⇒ Boolean
8 9 10 |
# File 'lib/dina/utils/identifier.rb', line 8 def is_wiki_id? ::Dina::PersistentIdentifier.is_wiki_regex.match?(self) end |
#orcid_from_url ⇒ Object
20 21 22 |
# File 'lib/dina/utils/identifier.rb', line 20 def orcid_from_url ::Dina::PersistentIdentifier.extract_orcid_regex.match(self)[0] rescue nil end |
#wiki_from_url ⇒ Object
24 25 26 |
# File 'lib/dina/utils/identifier.rb', line 24 def wiki_from_url ::Dina::PersistentIdentifier.extract_wiki_regex.match(self)[0] rescue nil end |