Exception: WifiWand::NetworkDisconnectionError
- Defined in:
- lib/wifi_wand/errors.rb
Instance Attribute Summary collapse
-
#network_name ⇒ Object
readonly
Returns the value of attribute network_name.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(network_name:, reason: nil) ⇒ NetworkDisconnectionError
constructor
A new instance of NetworkDisconnectionError.
Methods inherited from Error
#append_help_hint?, #display_message, #exception, #message_for_display
Constructor Details
#initialize(network_name:, reason: nil) ⇒ NetworkDisconnectionError
Returns a new instance of NetworkDisconnectionError.
57 58 59 60 61 62 63 64 |
# File 'lib/wifi_wand/errors.rb', line 57 def initialize(network_name:, reason: nil) @network_name = network_name @reason = reason msg = network_name ? "Failed to disconnect from network '#{network_name}'" : 'Failed to disconnect from current network' msg += ": #{reason}" if reason super(msg) end |
Instance Attribute Details
#network_name ⇒ Object (readonly)
Returns the value of attribute network_name.
55 56 57 |
# File 'lib/wifi_wand/errors.rb', line 55 def network_name @network_name end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
55 56 57 |
# File 'lib/wifi_wand/errors.rb', line 55 def reason @reason end |