class NistPubid::Publisher
Attributes
publisher[RW]
Public Class Methods
new(publisher:)
click to toggle source
# File lib/nist_pubid/publisher.rb, line 8 def initialize(publisher:) @publisher = publisher end
publishers_keys()
click to toggle source
# File lib/nist_pubid/publisher.rb, line 18 def self.publishers_keys PUBLISHERS["long"].keys end
regexp()
click to toggle source
# File lib/nist_pubid/publisher.rb, line 22 def self.regexp /(#{PUBLISHERS["long"].keys.join('|')})(?=\.|\s)/ end
Public Instance Methods
to_s(format = :short)
click to toggle source
# File lib/nist_pubid/publisher.rb, line 12 def to_s(format = :short) return @publisher if %i[short mr].include?(format) PUBLISHERS[format.to_s][@publisher] end