Class: Saml::Kit::Cli::YamlRegistry

Inherits:
DefaultRegistry
  • Object
show all
Defined in:
lib/saml/kit/cli/yaml_registry.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ YamlRegistry

Returns a new instance of YamlRegistry.



5
6
7
# File 'lib/saml/kit/cli/yaml_registry.rb', line 5

def initialize(path)
  @items = YAML::Store.new(path)
end

Instance Method Details

#eachObject



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

def each
  with_transaction do |db|
    db.roots.each do |key|
      yield (key)
    end
  end
end

#metadata_for(entity_id) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/saml/kit/cli/yaml_registry.rb', line 16

def (entity_id)
  with_transaction do |db|
    xml = db[entity_id]
    return nil if xml.nil?
    Saml::Kit::.from(xml)
  end
end

#register(metadata) ⇒ Object



9
10
11
12
13
14
# File 'lib/saml/kit/cli/yaml_registry.rb', line 9

def register()
  with_transaction do |db|
    db[.entity_id] = .to_xml
  end
  
end