Sha256: 6f2b8d65c4bdef582cbab4e9711b1bb4882c2a4fe20daae184c47438a85c33b1
Contents?: true
Size: 628 Bytes
Versions: 2
Compression:
Stored size: 628 Bytes
Contents
SERIES = YAML.load_file(File.join(File.dirname(__FILE__), "../../series.yaml")) module NistPubid class Serie attr_accessor :serie def initialize(serie:) @serie = serie == "NISTIR" ? "NIST IR" : serie end def to_s(format = :short) return @serie if %i[short mr].include?(format) result = SERIES[format.to_s][@serie] return SERIES["long"][@serie] if result.nil? result end def self.regexp /(#{(SERIES["long"].keys + SERIES["mr"].values .map { |v| v.gsub(".", '\.') } + ["NISTIR"]) .sort_by(&:length).reverse.join('|')})/ end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nist-pubid-0.1.7 | lib/nist_pubid/serie.rb |
nist-pubid-0.1.6 | lib/nist_pubid/serie.rb |