Class: RelatonNist::HitCollection
- Inherits:
-
RelatonBib::HitCollection
- Object
- RelatonBib::HitCollection
- RelatonNist::HitCollection
- Defined in:
- lib/relaton_nist/hit_collection.rb
Overview
Page of hit collection.
Constant Summary collapse
- DOMAIN =
"https://csrc.nist.gov"
- PUBS_EXPORT =
URI.join(DOMAIN, "/CSRC/media/feeds/metanorma/pubs-export")
- DATAFILEDIR =
File. ".relaton/nist", Dir.home
- DATAFILE =
File. "pubs-export.zip", DATAFILEDIR
Instance Method Summary collapse
-
#initialize(ref_nbr, year = nil, opts = {}) ⇒ HitCollection
constructor
A new instance of HitCollection.
Constructor Details
#initialize(ref_nbr, year = nil, opts = {}) ⇒ HitCollection
Returns a new instance of HitCollection.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/relaton_nist/hit_collection.rb', line 21 def initialize(ref_nbr, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize super ref_nbr, year /(?<docid>(SP|FIPS)\s[0-9-]+\w?)/ =~ text @array = docid ? from_json(docid, **opts) : from_csrc(**opts) @array.sort! do |a, b| if a.sort_value != b.sort_value b.sort_value - a.sort_value else (b.hit[:release_date] - a.hit[:release_date]).to_i end end end |