Class: Saml::Kit::Cli::Commands::Metadata

Inherits:
Thor
  • Object
show all
Defined in:
lib/saml/kit/cli/commands/metadata.rb

Instance Method Summary collapse

Instance Method Details

#listObject



14
15
16
17
18
19
20
21
# File 'lib/saml/kit/cli/commands/metadata.rb', line 14

def list
  if registry.count.zero?
    say('Register metadata using `saml-kit metadata register <url>`')
  end
  registry.each do |x|
    say x.entity_id, :green
  end
end

#register(url) ⇒ Object



9
10
11
# File 'lib/saml/kit/cli/commands/metadata.rb', line 9

def register(url)
  say registry.register_url(url).to_xml(pretty: true), :green
end

#show(entity_id) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/saml/kit/cli/commands/metadata.rb', line 24

def show(entity_id)
   = registry.(entity_id)
  if 
    Report.new().print(self)
  else
    say "`#{entity_id}` is not registered", :red
  end
end