Class: MDQT::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/mdqt/client.rb,
lib/mdqt/client/metadata_file.rb,
lib/mdqt/client/identifier_utils.rb,
lib/mdqt/client/metadata_service.rb,
lib/mdqt/client/metadata_response.rb,
lib/mdqt/client/metadata_validator.rb
Defined Under Namespace
Modules: IdentifierUtils
Classes: MetadataFile, MetadataResponse, MetadataService, MetadataValidator
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(base_url, options = {}) ⇒ Client
Returns a new instance of Client.
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/mdqt/client.rb', line 22
def initialize(base_url, options={})
@base_url = base_url
@verbose = options[:verbose] || false
@explain = options[:explain] || false
@tls_cert_check = options[:tls_risky] ? false : true
@cache_type = options[:cache_type] || :none
@md_service = MetadataService.new(@base_url, verbose: @verbose, cache_type: @cache_type, explain: @explain, tls_cert_check: tls_cert_check?)
@md_service.tidy_cache!
end
|
Class Method Details
.verification_available? ⇒ Boolean
18
19
20
|
# File 'lib/mdqt/client.rb', line 18
def self.verification_available?
@xmlsig_available
end
|
Instance Method Details
#base_url ⇒ Object
51
52
53
|
# File 'lib/mdqt/client.rb', line 51
def base_url
@base_url
end
|
#cache_reset! ⇒ Object
71
72
73
|
# File 'lib/mdqt/client.rb', line 71
def cache_reset!
md_service.purge_cache!
end
|
#cache_type ⇒ Object
67
68
69
|
# File 'lib/mdqt/client.rb', line 67
def cache_type
@cache_type
end
|
#exists?(entity_id) ⇒ Boolean
43
44
45
|
# File 'lib/mdqt/client.rb', line 43
def exists?(entity_id)
md_service.exists?(entity_id)
end
|
#explain? ⇒ Boolean
59
60
61
|
# File 'lib/mdqt/client.rb', line 59
def explain?
@explain
end
|
39
40
41
|
# File 'lib/mdqt/client.rb', line 39
def get_metadata(entity_id)
md_service.get(entity_id)
end
|
35
36
37
|
# File 'lib/mdqt/client.rb', line 35
def open_metadata(filename)
MetadataFile.new(filename, verbose: @verbose)
end
|
#tls_cert_check? ⇒ Boolean
63
64
65
|
# File 'lib/mdqt/client.rb', line 63
def tls_cert_check?
@tls_cert_check
end
|
#verbose? ⇒ Boolean
55
56
57
|
# File 'lib/mdqt/client.rb', line 55
def verbose?
@verbose
end
|