Class: MDQT::Client

Inherits:
Object
  • 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
# 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?)

end

Class Method Details

.verification_available?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/mdqt/client.rb', line 18

def self.verification_available?
  @xmlsig_available
end

Instance Method Details

#base_urlObject



46
47
48
# File 'lib/mdqt/client.rb', line 46

def base_url
  @base_url
end

#cache_reset!Object



66
67
68
# File 'lib/mdqt/client.rb', line 66

def cache_reset!
  md_service.purge_cache!
end

#cache_typeObject



62
63
64
# File 'lib/mdqt/client.rb', line 62

def cache_type
  @cache_type
end

#explain?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/mdqt/client.rb', line 54

def explain?
  @explain
end

#get_metadata(entity_id) ⇒ Object



38
39
40
# File 'lib/mdqt/client.rb', line 38

def (entity_id)
  md_service.get(entity_id)
end

#open_metadata(filename) ⇒ Object



34
35
36
# File 'lib/mdqt/client.rb', line 34

def (filename)
  MetadataFile.new(filename, verbose: @verbose)
end

#tls_cert_check?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/mdqt/client.rb', line 58

def tls_cert_check?
  @tls_cert_check
end

#transform_uri(uri) ⇒ Object



42
43
44
# File 'lib/mdqt/client.rb', line 42

def transform_uri(uri)
  MDQT::Client::IdentifierUtils.transform_uri(uri)
end

#verbose?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/mdqt/client.rb', line 50

def verbose?
  @verbose
end