Class: RelatonCalconnect::HitCollection
- Inherits:
-
RelatonBib::HitCollection
- Object
- RelatonBib::HitCollection
- RelatonCalconnect::HitCollection
- Defined in:
- lib/relaton_calconnect/hit_collection.rb
Constant Summary collapse
- GHURL =
ENDPOINT = “standards.calconnect.org/relaton/index.yaml”.freeze ENDPOINT = “127.0.0.1:4000/relaton/index.yaml”.freeze DATADIR = File.expand_path “.relaton/calconnect”, Dir.home DATAFILE = File.expand_path “bibliography.yml”, DATADIR ETAGFILE = File.expand_path “etag.txt”, DATADIR
"https://raw.githubusercontent.com/relaton/relaton-data-calconnect/main/".freeze
- INDEX_FILE =
"index-v1.yaml".freeze
Instance Method Summary collapse
-
#initialize(ref, year = nil) ⇒ HitCollection
constructor
A new instance of HitCollection.
Constructor Details
#initialize(ref, year = nil) ⇒ HitCollection
Returns a new instance of HitCollection.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/relaton_calconnect/hit_collection.rb', line 18 def initialize(ref, year = nil) super # @array = from_yaml(ref).sort_by do |hit| # hit.hit["revdate"] ? Date.parse(hit.hit["revdate"]) : Date.new # end.reverse index = Relaton::Index.find_or_create :CC, url: "#{GHURL}index-v1.zip", file: INDEX_FILE @array = index.search(ref).map do |row| Hit.new(row, self) end end |