Class: MuninPlugin::Attribute
- Inherits:
-
Object
- Object
- MuninPlugin::Attribute
- Defined in:
- lib/munin_plugin.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Attribute
constructor
A new instance of Attribute.
- #method_missing(method, *args, &block) ⇒ Object
- #to_s ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/munin_plugin.rb', line 17 def method_missing(method, *args, &block) @name = [name, method].join(".") @args = args self end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/munin_plugin.rb', line 5 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/munin_plugin.rb', line 5 def name @name end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/munin_plugin.rb', line 23 def to_s [name, *args].uniq.join(' ') end |