Class: Puppet::Settings::AliasSetting
- Defined in:
- lib/puppet/settings/alias_setting.rb
Instance Attribute Summary collapse
-
#alias_name ⇒ Object
readonly
Returns the value of attribute alias_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #getopt_args ⇒ Object
-
#initialize(args = {}) ⇒ AliasSetting
constructor
A new instance of AliasSetting.
- #method_missing(method, *args) ⇒ Object
- #optparse_args ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ AliasSetting
Returns a new instance of AliasSetting.
6 7 8 9 10 |
# File 'lib/puppet/settings/alias_setting.rb', line 6 def initialize(args = {}) @name = args[:name] @alias_name = args[:alias_for] @alias_for = Puppet.settings.setting(alias_name) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
28 29 30 31 32 |
# File 'lib/puppet/settings/alias_setting.rb', line 28 def method_missing(method, *args) alias_for.send(method, *args) rescue => e Puppet.log_exception(self.class, e.) end |
Instance Attribute Details
#alias_name ⇒ Object (readonly)
Returns the value of attribute alias_name.
4 5 6 |
# File 'lib/puppet/settings/alias_setting.rb', line 4 def alias_name @alias_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/puppet/settings/alias_setting.rb', line 4 def name @name end |
Instance Method Details
#getopt_args ⇒ Object
18 19 20 21 22 |
# File 'lib/puppet/settings/alias_setting.rb', line 18 def getopt_args args = @alias_for.getopt_args args[0].gsub!(alias_name.to_s, name.to_s) args end |
#optparse_args ⇒ Object
12 13 14 15 16 |
# File 'lib/puppet/settings/alias_setting.rb', line 12 def optparse_args args = @alias_for.optparse_args args[0].gsub!(alias_name.to_s, name.to_s) args end |
#type ⇒ Object
24 25 26 |
# File 'lib/puppet/settings/alias_setting.rb', line 24 def type :alias end |