Class: Net::SNMP::TrapHandler
- Inherits:
-
Object
- Object
- Net::SNMP::TrapHandler
- Extended by:
- Forwardable
- Includes:
- Debug
- Defined in:
- lib/net/snmp/trap_handler/trap_handler.rb
Instance Attribute Summary collapse
-
#inform_handler ⇒ Object
Returns the value of attribute inform_handler.
-
#listener ⇒ Object
Returns the value of attribute listener.
-
#message ⇒ Object
Returns the value of attribute message.
-
#pdu ⇒ Object
Returns the value of attribute pdu.
-
#v1_handler ⇒ Object
Returns the value of attribute v1_handler.
-
#v2_handler ⇒ Object
Returns the value of attribute v2_handler.
Instance Method Summary collapse
-
#initialize(&block) ⇒ TrapHandler
constructor
A new instance of TrapHandler.
Methods included from Debug
Constructor Details
#initialize(&block) ⇒ TrapHandler
Returns a new instance of TrapHandler.
9 10 11 12 13 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 9 def initialize(&block) @listener = Net::SNMP::Listener.new @listener.(&method(:process_trap)) self.instance_eval(&block) end |
Instance Attribute Details
#inform_handler ⇒ Object
Returns the value of attribute inform_handler.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def inform_handler @inform_handler end |
#listener ⇒ Object
Returns the value of attribute listener.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def listener @listener end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def @message end |
#pdu ⇒ Object
Returns the value of attribute pdu.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def pdu @pdu end |
#v1_handler ⇒ Object
Returns the value of attribute v1_handler.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def v1_handler @v1_handler end |
#v2_handler ⇒ Object
Returns the value of attribute v2_handler.
6 7 8 |
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6 def v2_handler @v2_handler end |