Class: Net::SNMP::MIB::Node
- Inherits:
-
Object
- Object
- Net::SNMP::MIB::Node
- Extended by:
- Forwardable
- Defined in:
- lib/net/snmp/mib/node.rb
Instance Attribute Summary collapse
-
#struct ⇒ Object
Returns the value of attribute struct.
Class Method Summary collapse
Instance Method Summary collapse
- #children ⇒ Object
- #description ⇒ Object
-
#initialize(arg) ⇒ Node
constructor
A new instance of Node.
-
#next ⇒ Object
actually seems like list is linked backward, so this will retrieve the previous oid numerically.
- #oid ⇒ Object
- #parent ⇒ Object
- #siblings ⇒ Object
Constructor Details
Instance Attribute Details
#struct ⇒ Object
Returns the value of attribute struct.
5 6 7 |
# File 'lib/net/snmp/mib/node.rb', line 5 def struct @struct end |
Class Method Details
Instance Method Details
#children ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/net/snmp/mib/node.rb', line 47 def children return nil unless @struct.child_list child = self.class.new(@struct.child_list) children = [child] while child = child.next children << child end children.pop children.reverse # For some reason, net-snmp returns everything backwards end |
#description ⇒ Object
27 28 29 |
# File 'lib/net/snmp/mib/node.rb', line 27 def description @struct.description.read_string end |
#next ⇒ Object
actually seems like list is linked backward, so this will retrieve the previous oid numerically
37 38 39 40 |
# File 'lib/net/snmp/mib/node.rb', line 37 def next return nil unless @struct.next_peer self.class.new(@struct.next_peer) end |
#oid ⇒ Object
31 32 33 34 |
# File 'lib/net/snmp/mib/node.rb', line 31 def oid return @oid if @oid @oid = OID.new(label) end |
#parent ⇒ Object
42 43 44 45 |
# File 'lib/net/snmp/mib/node.rb', line 42 def parent return nil unless @struct.parent self.class.new(@struct.parent) end |
#siblings ⇒ Object
58 59 60 |
# File 'lib/net/snmp/mib/node.rb', line 58 def siblings parent.children end |