Class: Net::SNMP::V2TrapDsl
- Inherits:
-
Object
- Object
- Net::SNMP::V2TrapDsl
- Includes:
- Debug
- Defined in:
- lib/net/snmp/trap_handler/v2_trap_dsl.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message) ⇒ V2TrapDsl
constructor
A new instance of V2TrapDsl.
- #oid ⇒ Object (also: #trap_oid)
- #pdu ⇒ Object
- #uptime ⇒ Object
- #varbinds ⇒ Object
Methods included from Debug
Constructor Details
#initialize(message) ⇒ V2TrapDsl
Returns a new instance of V2TrapDsl.
7 8 9 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 7 def initialize() @message = end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 5 def @message end |
Instance Method Details
#oid ⇒ Object Also known as: trap_oid
15 16 17 18 19 20 21 22 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 15 def oid vb = varbinds.find{|vb| vb.oid.to_s == Constants::OID_SNMP_TRAP_OID} if vb vb.value else nil end end |
#pdu ⇒ Object
11 12 13 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 11 def pdu .pdu end |
#uptime ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 25 def uptime vb = varbinds.find{|vb| vb.oid.to_s == Constants::OID_SYS_UP_TIME_INSTANCE} if vb vb.value else nil end end |
#varbinds ⇒ Object
34 35 36 |
# File 'lib/net/snmp/trap_handler/v2_trap_dsl.rb', line 34 def varbinds pdu.varbinds end |