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.
4 5 6 7 8 |
# File 'lib/puppet/settings/alias_setting.rb', line 4 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
26 27 28 29 30 31 32 |
# File 'lib/puppet/settings/alias_setting.rb', line 26 def method_missing(method, *args) begin alias_for.send(method, *args) rescue => e Puppet.log_exception(self.class, e.) end end |
Instance Attribute Details
#alias_name ⇒ Object (readonly)
Returns the value of attribute alias_name.
2 3 4 |
# File 'lib/puppet/settings/alias_setting.rb', line 2 def alias_name @alias_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/puppet/settings/alias_setting.rb', line 2 def name @name end |
Instance Method Details
#getopt_args ⇒ Object
16 17 18 19 20 |
# File 'lib/puppet/settings/alias_setting.rb', line 16 def getopt_args args = @alias_for.getopt_args args[0].gsub!(alias_name.to_s, name.to_s) args end |
#optparse_args ⇒ Object
10 11 12 13 14 |
# File 'lib/puppet/settings/alias_setting.rb', line 10 def optparse_args args = @alias_for.optparse_args args[0].gsub!(alias_name.to_s, name.to_s) args end |
#type ⇒ Object
22 23 24 |
# File 'lib/puppet/settings/alias_setting.rb', line 22 def type :alias end |