Class: RelatonOgc::HitCollection
- Inherits:
-
RelatonBib::HitCollection
- Object
- RelatonBib::HitCollection
- RelatonOgc::HitCollection
- Defined in:
- lib/relaton_ogc/hit_collection.rb
Constant Summary collapse
- ENDPOINT =
"https://raw.githubusercontent.com/opengeospatial/"\ "NamingAuthority/master/incubation/bibliography/bibliography.json".freeze
- DATADIR =
File. ".relaton/ogc/", Dir.home
- DATAFILE =
File. "bibliography.json", DATADIR
- ETAGFILE =
File. "etag.txt", DATADIR
Instance Method Summary collapse
-
#initialize(ref, year = nil, _opts = {}) ⇒ HitCollection
constructor
A new instance of HitCollection.
Constructor Details
#initialize(ref, year = nil, _opts = {}) ⇒ HitCollection
Returns a new instance of HitCollection.
16 17 18 19 20 21 22 23 24 |
# File 'lib/relaton_ogc/hit_collection.rb', line 16 def initialize(ref, year = nil, _opts = {}) @text = ref @year = year @fetched = false hits = from_json(ref).sort_by do |hit| hit.hit["date"] ? Date.parse(hit.hit["date"]) : Date.new end concat hits.reverse end |