Class: Identifiers::RepecId

Inherits:
Object
  • Object
show all
Defined in:
lib/identifiers/repec_id.rb

Class Method Summary collapse

Class Method Details

.extract(str) ⇒ Object



3
4
5
6
7
8
# File 'lib/identifiers/repec_id.rb', line 3

def self.extract(str)
  str
    .to_s
    .scan(/\brepec:[^[:space:]]+\b/i)
    .map { |repec| "RePEc:#{repec.split(':', 2).last}" }
end