Class: WifiWand::Platforms::Mac::Helper::Setup::Result
- Inherits:
-
Struct
- Object
- Struct
- WifiWand::Platforms::Mac::Helper::Setup::Result
- Defined in:
- lib/wifi_wand/platforms/mac/helper/setup.rb
Overview
Immutable value object describing the current state of the helper.
Instance Attribute Summary collapse
-
#authorized ⇒ Object
Returns the value of attribute authorized.
-
#helper_applicable ⇒ Object
Returns the value of attribute helper_applicable.
-
#installed ⇒ Object
Returns the value of attribute installed.
-
#macos_version ⇒ Object
Returns the value of attribute macos_version.
-
#permission_message ⇒ Object
Returns the value of attribute permission_message.
-
#valid ⇒ Object
Returns the value of attribute valid.
Instance Method Summary collapse
- #authorized? ⇒ Boolean
- #helper_applicable? ⇒ Boolean
- #installed? ⇒ Boolean
- #not_applicable? ⇒ Boolean
-
#reinstall_recommended? ⇒ Boolean
True when the helper is on disk but failed structural validation (e.g. the bundle is corrupt or the executable does not respond to the
helpcommand). -
#setup_complete? ⇒ Boolean
True only when the helper is installed, structurally valid, and macOS location permission has been granted.
-
#steps_needed ⇒ Object
Ordered list of symbolic steps still required.
- #valid? ⇒ Boolean
Instance Attribute Details
#authorized ⇒ Object
Returns the value of attribute authorized
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def @authorized end |
#helper_applicable ⇒ Object
Returns the value of attribute helper_applicable
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def helper_applicable @helper_applicable end |
#installed ⇒ Object
Returns the value of attribute installed
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def installed @installed end |
#macos_version ⇒ Object
Returns the value of attribute macos_version
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def macos_version @macos_version end |
#permission_message ⇒ Object
Returns the value of attribute permission_message
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def @permission_message end |
#valid ⇒ Object
Returns the value of attribute valid
31 32 33 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 31 def valid @valid end |
Instance Method Details
#authorized? ⇒ Boolean
42 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 42 def = |
#helper_applicable? ⇒ Boolean
43 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 43 def helper_applicable? = helper_applicable != false |
#installed? ⇒ Boolean
40 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 40 def installed? = installed |
#not_applicable? ⇒ Boolean
44 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 44 def not_applicable? = !helper_applicable? |
#reinstall_recommended? ⇒ Boolean
True when the helper is on disk but failed structural validation
(e.g. the bundle is corrupt or the executable does not respond to the
help command). In this case reinstall is preferable to a first-time install.
53 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 53 def reinstall_recommended? = helper_applicable? && installed? && !valid? |
#setup_complete? ⇒ Boolean
True only when the helper is installed, structurally valid, and macOS location permission has been granted.
48 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 48 def setup_complete? = helper_applicable? && installed? && valid? && |
#steps_needed ⇒ Object
Ordered list of symbolic steps still required. Callers map these to human-readable labels and execution logic.
57 58 59 60 61 62 63 64 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 57 def steps_needed return [] unless helper_applicable? return %i[reinstall_helper grant_permission] if reinstall_recommended? return %i[install_helper grant_permission] unless installed? return %i[grant_permission] unless [] end |
#valid? ⇒ Boolean
41 |
# File 'lib/wifi_wand/platforms/mac/helper/setup.rb', line 41 def valid? = valid |