Class: SNMP::ResponseError
- Inherits:
-
Object
- Object
- SNMP::ResponseError
- Defined in:
- lib/snmp4em/extensions/snmp/response_error.rb
Instance Attribute Summary collapse
-
#error_status ⇒ Object
readonly
Returns the value of attribute error_status.
Instance Method Summary collapse
-
#initialize(error) ⇒ ResponseError
constructor
Accepts either a string (from SNMP::PDU.error_status) or one of SNMP::EndOfMibView, SNMP::NoSuchObject, or SNMP::NoSuchInstance.
- #rubify ⇒ Object
-
#to_s ⇒ Object
String representation of this error.
Constructor Details
#initialize(error) ⇒ ResponseError
Accepts either a string (from SNMP::PDU.error_status) or one of SNMP::EndOfMibView, SNMP::NoSuchObject, or SNMP::NoSuchInstance
7 8 9 10 11 12 13 |
# File 'lib/snmp4em/extensions/snmp/response_error.rb', line 7 def initialize(error) if [SNMP::EndOfMibView, SNMP::NoSuchObject, SNMP::NoSuchInstance].include? error @error_status = error.asn1_type.to_sym else @error_status = error.to_sym end end |
Instance Attribute Details
#error_status ⇒ Object (readonly)
Returns the value of attribute error_status.
4 5 6 |
# File 'lib/snmp4em/extensions/snmp/response_error.rb', line 4 def error_status @error_status end |
Instance Method Details
#rubify ⇒ Object
20 21 22 |
# File 'lib/snmp4em/extensions/snmp/response_error.rb', line 20 def rubify return nil end |
#to_s ⇒ Object
String representation of this error
16 17 18 |
# File 'lib/snmp4em/extensions/snmp/response_error.rb', line 16 def to_s @error_status.to_s end |