Class: ProcessWanker::ConfigNode
- Inherits:
-
Object
- Object
- ProcessWanker::ConfigNode
- Defined in:
- lib/config/config_node.rb
Direct Known Subclasses
ConfigAuth, ConfigClient, ConfigClientCluster, ConfigClientClusters, ConfigClientHost, ConfigDaemon, ConfigDaemonService, ConfigDaemonServiceDependency, ConfigDaemonServices, ConfigHook, ConfigSMTP, Configuration
Instance Attribute Summary collapse
-
#container ⇒ Object
Returns the value of attribute container.
Instance Method Summary collapse
-
#find_attributes(name) ⇒ Object
find_attributes.
-
#get_auth ⇒ Object
find the innermost auth block.
Instance Attribute Details
#container ⇒ Object
Returns the value of attribute container.
19 20 21 |
# File 'lib/config/config_node.rb', line 19 def container @container end |
Instance Method Details
#find_attributes(name) ⇒ Object
find_attributes
walk from the current object up to the root, looking for the named attribute
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/config/config_node.rb', line 29 def find_attributes(name) r=[] p=self while(p) if(p.respond_to?(name)) v=p.send(name) r << v if(v) end break if(!p.respond_to?("container")) p=p.container end r end |
#get_auth ⇒ Object
find the innermost auth block
44 45 46 |
# File 'lib/config/config_node.rb', line 44 def get_auth() find_attributes("auth").first end |