Exception: WifiWand::InvalidNetworkNameError
- 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: 'Network name cannot be empty') ⇒ InvalidNetworkNameError
constructor
A new instance of InvalidNetworkNameError.
Methods inherited from Error
#append_help_hint?, #display_message, #exception, #message_for_display
Constructor Details
#initialize(network_name:, reason: 'Network name cannot be empty') ⇒ InvalidNetworkNameError
Returns a new instance of InvalidNetworkNameError.
139 140 141 142 143 144 |
# File 'lib/wifi_wand/errors.rb', line 139 def initialize(network_name:, reason: 'Network name cannot be empty') @network_name = network_name @reason = reason display_name = network_name.to_s super("Invalid network name: '#{display_name}'. #{reason}") end |
Instance Attribute Details
#network_name ⇒ Object (readonly)
Returns the value of attribute network_name.
137 138 139 |
# File 'lib/wifi_wand/errors.rb', line 137 def network_name @network_name end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
137 138 139 |
# File 'lib/wifi_wand/errors.rb', line 137 def reason @reason end |