Class: R509::Config::CaConfigPool
- Inherits:
-
Object
- Object
- R509::Config::CaConfigPool
- Defined in:
- lib/r509/config.rb
Overview
pool of configs, so we can support multiple CAs from a single config file
Class Method Summary (collapse)
-
+ (Object) from_yaml(name, yaml_data, opts = {})
Loads the named configuration config from a yaml string.
Instance Method Summary (collapse)
-
- (Object) [](name)
retrieve a particular config by its name.
-
- (Object) all
A list of all the configs in this pool.
-
- (CaConfigPool) initialize(configs)
constructor
A new instance of CaConfigPool.
-
- (Object) names
get all the config names.
Constructor Details
- (CaConfigPool) initialize(configs)
A new instance of CaConfigPool
93 94 95 |
# File 'lib/r509/config.rb', line 93 def initialize(configs) @configs = configs end |
Class Method Details
+ (Object) from_yaml(name, yaml_data, opts = {})
Loads the named configuration config from a yaml string.
116 117 118 119 120 121 122 123 |
# File 'lib/r509/config.rb', line 116 def self.from_yaml(name, yaml_data, opts = {}) conf = YAML.load(yaml_data) configs = {} conf[name].each_pair do |ca_name, data| configs[ca_name] = R509::Config::CaConfig.load_from_hash(data, opts) end R509::Config::CaConfigPool.new(configs) end |
Instance Method Details
- (Object) [](name)
retrieve a particular config by its name
103 104 105 |
# File 'lib/r509/config.rb', line 103 def [](name) @configs[name] end |
- (Object) all
A list of all the configs in this pool
108 109 110 |
# File 'lib/r509/config.rb', line 108 def all @configs.values end |
- (Object) names
get all the config names
98 99 100 |
# File 'lib/r509/config.rb', line 98 def names @configs.keys end |