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
256 257 258 |
# File 'lib/r509/config.rb', line 256 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.
279 280 281 282 283 284 285 286 |
# File 'lib/r509/config.rb', line 279 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
266 267 268 |
# File 'lib/r509/config.rb', line 266 def [](name) @configs[name] end |
- (Object) all
A list of all the configs in this pool
271 272 273 |
# File 'lib/r509/config.rb', line 271 def all @configs.values end |
- (Object) names
get all the config names
261 262 263 |
# File 'lib/r509/config.rb', line 261 def names @configs.keys end |