class QB::Ansible::ConfigFile::Defaults
Wrapper around the Hash from the `[defaults]` group in an Asnible config file.
Instances are returned from {QB::Ansible::ConfigFile#defaults}.
Attributes
rel_root[R]
@!attribute [r] rel_root
@return [Pathname] Absolute path to use as root for relative paths.
Public Class Methods
new(source, rel_root: super())
click to toggle source
Instantiate a new `QB::Ansible::ConfigFile`.
@param [#each_pair] source
Source for the keys and values.
# File lib/qb/ansible/config_file.rb, line 60 def initialize source, rel_root: super() source.each_pair { |k, v| self[k] = v } @rel_root = rel_root end
Public Instance Methods
roles_path()
click to toggle source
@return [Array<Pathname>]
Array of resolved (absolute) {Pathname} instances parsed from the `roles_path` value. Empty array `roles_path` key is missing.
# File lib/qb/ansible/config_file.rb, line 74 def roles_path if key? 'roles_path' self['roles_path']. split(':'). map { |path| QB::Util.resolve @rel_root, path } else [] end end