Class: MDQT::CLI::URL

Inherits:
Base
  • Object
show all
Defined in:
lib/mdqt/cli/url.rb

Instance Method Summary collapse

Methods inherited from Base

#advise_on_xml_signing_support, #args, #btw, check_requirements, #colour_shell?, #explain, #extract_certificate_paths, #get_stdin, #halt!, #hey, #initialize, introduce, #options, #options=, #output, #pastel, #pipeable?, run, #say, #service_url, service_url, #yay

Constructor Details

This class inherits a constructor from MDQT::CLI::Base

Instance Method Details

#build_url(mds, entity_id) ⇒ Object



28
29
30
31
# File 'lib/mdqt/cli/url.rb', line 28

def build_url(mds, entity_id)

  URI.join(service_url(options), "entities/#{mds.prepare_id(entity_id)}")
end

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mdqt/cli/url.rb', line 10

def run

  mds = MDQT::Client::MetadataService.new(service_url(options),
                            verbose:false,
                            cache_type: :none,
                            explain: false,
                            tls_cert_check: false)

  if args.empty?
    puts service_url(options)
  else
    args.each do |arg|
      puts build_url(mds, arg)
    end
  end

end