Class: Net::SNMP::Module
- Inherits:
-
Object
- Object
- Net::SNMP::Module
- Extended by:
- Forwardable
- Defined in:
- lib/net/snmp/mib/module.rb
Class Method Summary collapse
-
.find(module_id) ⇒ Object
Gets a module node by its id.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(struct) ⇒ Module
constructor
A new instance of Module.
- #name ⇒ Object
- #next ⇒ Object
Constructor Details
#initialize(struct) ⇒ Module
Returns a new instance of Module.
17 18 19 20 |
# File 'lib/net/snmp/mib/module.rb', line 17 def initialize(struct) raise "Tried to initialize null module" if struct.null? @struct = struct end |
Class Method Details
.find(module_id) ⇒ Object
Gets a module node by its id
9 10 11 12 13 14 15 |
# File 'lib/net/snmp/mib/module.rb', line 9 def self.find(module_id) if module_id < 0 nil else new(Wrapper.find_module(module_id)) end end |
Instance Method Details
#file ⇒ Object
26 27 28 |
# File 'lib/net/snmp/mib/module.rb', line 26 def file @struct.file.read_string end |
#name ⇒ Object
22 23 24 |
# File 'lib/net/snmp/mib/module.rb', line 22 def name @struct.name.read_string end |
#next ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/net/snmp/mib/module.rb', line 30 def next if @struct.next.null? nil else self.class.new(@struct.next) end end |