Class: Rut::App
- Inherits:
-
Object
- Object
- Rut::App
- Includes:
- Methadone::CLILogging, Methadone::Main
- Defined in:
- lib/rut.rb
Instance Attribute Summary collapse
-
#router_ip ⇒ Object
Returns the value of attribute router_ip.
Class Method Summary collapse
- .exception_output(output, code) ⇒ Object
-
.run_and_handle_exceptions ⇒ Object
supplemental methods here.
Instance Attribute Details
#router_ip ⇒ Object
Returns the value of attribute router_ip.
9 10 11 |
# File 'lib/rut.rb', line 9 def router_ip @router_ip end |
Class Method Details
.exception_output(output, code) ⇒ Object
43 44 45 46 |
# File 'lib/rut.rb', line 43 def self.exception_output(output, code) puts output exit(code) end |
.run_and_handle_exceptions ⇒ Object
supplemental methods here
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rut.rb', line 32 def self.run_and_handle_exceptions yield rescue SNMP::RequestTimeout exception_output("Host #{@router_ip} not responding", 1) rescue SocketError exception_output("#{@router_ip} is an invalid ip address", 2) rescue Exception exception_output($!.inspect, 99) end |