Class: RelatonW3c::RDFArchive
- Inherits:
-
Object
- Object
- RelatonW3c::RDFArchive
- Defined in:
- lib/relaton_w3c/rdf_archive.rb
Instance Method Summary collapse
-
#get_data ⇒ RDF::Repository
Get RDF data from the updated archive file.
-
#initialize(file = "archive.rdf") ⇒ RDFArchive
constructor
A new instance of RDFArchive.
Constructor Details
#initialize(file = "archive.rdf") ⇒ RDFArchive
Returns a new instance of RDFArchive.
3 4 5 |
# File 'lib/relaton_w3c/rdf_archive.rb', line 3 def initialize(file = "archive.rdf") @file = file end |
Instance Method Details
#get_data ⇒ RDF::Repository
Get RDF data from the updated archive file.
12 13 14 15 16 17 18 |
# File 'lib/relaton_w3c/rdf_archive.rb', line 12 def get_data if !File.exist?(@file) || File.mtime(@file) < Time.now - 86_400 get_archive update_archive end RDF::Repository.load(@file) end |